Skip to content

Add separate flag serverMode for server mode #39735

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

Merged
merged 2 commits into from
Aug 3, 2020
Merged

Conversation

sheetalkamat
Copy link
Member

@sheetalkamat sheetalkamat commented Jul 24, 2020

this PR adds --serverMode which takes precedence over --syntaxOnly at any time.

Current names: (open to suggestion if we prefer something else)

export enum LanguageServiceMode {
        Semantic,
        ApproximateSemanticOnly,
        SyntaxOnly,
    }

@sheetalkamat sheetalkamat added this to the TypeScript 4.0.1 milestone Jul 24, 2020
Copy link
Member

@amcasey amcasey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. My bikeshedding would be Syntactic, ApproximateSemantic, Semantic for tidier parallelism, but I'm also fine with the current names (unless we call the feature "partial semantic mode", in which case, I think the enum should match).

@@ -3325,7 +3340,7 @@ namespace ts.server {
}

private telemetryOnOpenFile(scriptInfo: ScriptInfo): void {
if (this.syntaxOnly || !this.eventHandler || !scriptInfo.isJavaScript() || !addToSeen(this.allJsFilesForOpenFileTelemetry, scriptInfo.path)) {
if (this.serverMode !== LanguageServiceMode.Semantic || !this.eventHandler || !scriptInfo.isJavaScript() || !addToSeen(this.allJsFilesForOpenFileTelemetry, scriptInfo.path)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably an issue for a future PR, but I think the assumption here was that syntax server telemetry would be uninteresting. I'm not sure the same is true for the partial semantic server.

@DanielRosenwasser
Copy link
Member

SemanticWithDirectDependencyProjects can also work, but I guess PartialSemantic or ApproximateSemantic gives us some design room.

@DanielRosenwasser DanielRosenwasser merged commit aee78ac into master Aug 3, 2020
@sheetalkamat sheetalkamat deleted the syntaxToNewFlag branch August 3, 2020 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants