Skip to content

Introduce a --syntaxOnly server mode#23128

Merged
amcasey merged 1 commit into
microsoft:masterfrom
amcasey:SyntaxServerNoProgram
Apr 5, 2018
Merged

Introduce a --syntaxOnly server mode#23128
amcasey merged 1 commit into
microsoft:masterfrom
amcasey:SyntaxServerNoProgram

Conversation

@amcasey
Copy link
Copy Markdown
Member

@amcasey amcasey commented Apr 3, 2018

  1. Disable the LS in all projects
  2. Don't create Program objects

Replaces #23037 & #23033

@amcasey
Copy link
Copy Markdown
Member Author

amcasey commented Apr 3, 2018

@sheetalkamat @mhegazy Better? One switch throughout, loading config files, not creating programs.

I've tested manually, but I'm not going to add automated tests until people express satisfaction with the general approach.

@amcasey
Copy link
Copy Markdown
Member Author

amcasey commented Apr 3, 2018

I'm not thrilled about opening the config files because it creates some extra file watchers (for the config files themselves) and makes it harder for the editor to set flags, esp noLib, noResolve, noEmit, and types.

Edit: I've restored the config file change, but it's a separate commit so it's easy to revert.

Comment thread src/server/editorServices.ts Outdated
this.documentRegistry,
compilerOptions,
/*lastFileExceededProgramSize*/ this.getFilenameForExceededTotalSizeLimitForNonTsFiles(projectFileName, compilerOptions, files, externalFilePropertyReader),
/*languageServicePermanentlyDisabled*/this.syntaxOnly,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why do you need to pass this to each project, that should be checked by each project by just checking this.projectService.syntaxOnly?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Just an oversight.

projectRootPath?: NormalizedPath) {

if (this.syntaxOnly) {
return undefined;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I thought the idea was to create program but not bind it. Are we not going to do that. This means if file opened is from configured project, it wont pick its compiler options?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

What does the program provide if we are not binding it?

Yes, I think we want to disregard the compiler options of configured projects - we specifically don't want to (e.g.) emit, load lib files, resolve, download types, etc.

@@ -1,114 +0,0 @@
// @module: commonjs
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do not think it is intentional to remove this file.

 1. Disable the LS in all projects
 2. Don't create Program objects
 3. Ignore config files
@amcasey amcasey force-pushed the SyntaxServerNoProgram branch from c03ea06 to 855171b Compare April 4, 2018 23:48
@amcasey amcasey merged commit 7dc9147 into microsoft:master Apr 5, 2018
@amcasey amcasey deleted the SyntaxServerNoProgram branch April 5, 2018 00:23
@microsoft microsoft locked and limited conversation to collaborators Jul 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants