Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow stopping of extension processing after comment line #55

Open
a-mckinley opened this issue Oct 4, 2022 · 3 comments
Open

Allow stopping of extension processing after comment line #55

a-mckinley opened this issue Oct 4, 2022 · 3 comments

Comments

@a-mckinley
Copy link

Is your enhancement related to a problem? Please describe.

Currently, /* plpgsql-language-server:disable */ is supported to disable extension processing for entire file.

Would it be possible to stop any extension processing beyond the comment as opposed to whole file?

My use case is for a data processing test script like

-- create tables
create table if not exists fake_table (
    id bigint
);
-- create plpgsql functions
create or replace function fake_function() returns void as
$$
 -- do time consuming data processing work
$$ language plpgsql;

-- execute one of these functions
select fake_function();

It would be great to allow the extension to give me feedback as normal on my tables,function definitions, but not execute the function at the bottom.

So if the extension supported:

-- create tables
create table if not exists fake_table (
    id bigint
);
-- create plpgsql functions
create or replace function fake_function() returns void as
$$
 -- do time consuming data processing work
$$ language plpgsql;

/* plpgsql-language-server:disable */
-- execute one of these functions
-- but disable the extension executing statements beyond this line
select fake_function();
@a-mckinley a-mckinley changed the title Allow stopping of extension processing after certain line Allow stopping of extension processing after comment line Oct 4, 2022
@yas7010uv
Copy link
Contributor

yas7010uv commented Oct 16, 2022

@a-mckinley

It is possible.

The concern is that the user may be confused as to whether to disable the entire subsequent file or only the following statement.

Perhaps an option to disable the following statement should be provided at the same time

/* plpgsql-language-server@statement:disable */

Also, I believe this issue is connected to #12 where we wanted to control by comments.

I am waiting for a parser to interpret comments, but perhaps I should include own processing.

In any case, I don't have time right now to get into this issue right away.

@yas7010uv
Copy link
Contributor

@a-mckinley

We have released v2.10.0.

In this release, it is possible to perform validation on each statement divided by comments and set the disable flag for each statement.

Please see this sample.

If this feature works for your purposes, please close this PR.
If not, please provide an additional description of the feature you really want.

@yas7010uv
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants