Skip to content

Compiler API - Make disableIncrementalParsing not a global variable #35158

Closed
@dsherret

Description

@dsherret

Search Terms

disableIncrementalParsing

Suggestion

Right now disabling incremental parsing is done via the public api like so:

ts.disableIncrementalParsing = true;

let disableIncrementalParsing: boolean;

This means that if someone sets this to true it will mess with anyone else that depends on it.

It would be nice if this was made non-global.

Workaround

function doWithIncrementalParsing(action: () => void) {
    const oldValue = ts.disableIncrementalParsing;
    ts.disableIncrementalParsing = false;
    try {
        action();
    } finally {
        ts.disableIncrementalParsing = oldValue;
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    APIRelates to the public API for TypeScriptAwaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions