As of 3c32f6e154, a line separator is
added between nodes if the nodes are not synthetic and on separate
lines. This it push s wrong and previously only happened if the non-synthetic
nodes were on different lines but had the same parent.
Fixes#44068.
* Add test showing how setting strict is not preserved in tsbuildinfo
Test for #44305
* Handle strict flag when writing tsbuildinfo
Fixes#44305
* Apply suggestions from code review
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
* Update the category descriptions for the tsconfig options
* Gets tests green
* Whitespace change
* Drop command line options from --init
* Go back to the old re-build baseline
* Fix numbers
* Remove formatting options from --showconfig
* Dpon't show output formatting changes in showConfig
* Update baselines
* Update baselines
* Tests to baseline tsserver instead of checking
Also ensures inferred and auto import projects have name per project service
* Log structureIsReused value
* more baselines
* Test showing the moduleResolutionCache reset issue with tsc --b --w
* Fix incorrect usage of ownMap by making it function returning ownMap instead of constant value
* Test where allowJs present in referenced project affects picking up right set of import files
* use options from referened project for including resolved imports in the file when using sources of project reference
Fixes#43909
* Handle localness in special cases by checking exported variable assignment
Fixes#42976
* Fix existing tests where arrow now behaves similar to function expression
* Update src/services/goToDefinition.ts
* Make the module resolution cache apis for updating compiler options or clearing it
* Cache package.json lookup results from module resolution
* Use per directory cache for type reference directive resolution as well
* Update Baselines and/or Applied Lint Fixes
* Change trace according to feedback
* Update Baselines and/or Applied Lint Fixes
Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
* Stopped removing unused imports in files with syntactic errors
* Added allowDestructiveCodeActions arg
* Updated .d.ts baselines
* Stop factoring syntax errors. Weird that no tests break...
* Have args extend scope so it is not a breaking change
* Update src/harness/harnessLanguageService.ts
Co-authored-by: Jesse Trinity <jetrinit@microsoft.com>
* Fixed API breaking change, and renamed to skip
* Always with the baselines
* One more .d.ts baseline to fix
* Remove blank line in src/harness/harnessLanguageService.ts
Co-authored-by: Jesse Trinity <jetrinit@microsoft.com>
* Serialize compiler options that are needed from old state when creating new state
* Dont write affectsGlobalScope if not true
* Encode FileInfo for better serialization size
* Update src/compiler/builder.ts
Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
* Specified diagnostic for CLI flags missing a required --build
* Switched to an alternateMode member
* Added --build-incompatible flags too
* Small fixups to remove a hardcoding
* Switched to ||= factories
* Not a function
* I think I get it now
* If target:esnext,then useDefineForClassFields: true will now be the default.
* Added error if a private identifier is used in a static a initializer if target:ESNext and useDefineForClassFields:false.
* Added test for new useDefineForClassFields default and error message.
* Fixed tests after changing the default of useDefineForClassFields to true for target esnext
* Fixed code review suggestions.
* Updated error message.
* Added missing static check for the containing property. Fixed other code review issues.
* Test that fails because of change in scriptKind of untitled file
* buckets are keyed with DocumentRegistryBucketKey
* Use scriptKind in document Registry to distinguish between files
Fixes#42613
* WIP
* WIP
* Get completion details working
* Start unifying eager and lazy auto imports
* Fix export=
* Fix completion details for totally misspelled names
* Almost fixed duplication...
* Fix remaining completion tests
* Refactor to support multiple origins for same symbol
* Make import fixes make slightly more sense
* Add cache back in
* Set insertText based on import kind
* Update API baselines
* Add semicolons, snippet support, and sourceDisplay
* Add some tests
* Update baselines
* Fix pattern ambient modules appearing in auto imports
* Fix tests
* Remove commented code
* Switch to valueDeclaration for getting module source file
* Small optimizations
* Cache module specifiers / importableness and export map separately
* Fix and test cache invalidation logic
* Update API baselines
* Add separate user preference for snippet-formatted completions
* Require first character to match when resolving module specifiers
* Fix AutoImportProvider export map cache invalidation
* Really fix auto import provider export map invalidation
* Update test added in master
* Use logical or assignment
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
* Simply conditional by reversing
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
* When file is deleted need to marked correctly in the project as removed file
* Simplify hasAddedOrRemovedSymlinks with cherry-picked fix
* Ensure replacement range is on one line
* Update baselines
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
* Test for not watchiong referenced projects fileNames and invalidating it
* Add watching wild card directories and caching parsed command line for projects so that its shared
* Handle config file watching and commandline cache together
* Watch extended files for commndline cache instead of project
* Use extended config cache now that we are watching extended config files
* Structure for getParsedCommandLine from the LS
* Adding some more skeleton with todos
* getParsedCommandLine on WatchCompilerHost
* Tests for Watch, LS scenarios
* Handle getParsedCommandLine so we are looking at all things for referenced
* Cleanup and commenting
* Test for transitive references with tsc-watch
* Cache parsed command line even if host implements getParsedCommandLine
* Cleanup
* Cleanup
* Some tests to verify exclude from referenced project doesnt trigger the update
* Baseline when program is same
* Test for incremental scenario
* Tests for output from referenced project
* Comments
* Extra tests in preparation for lazy signature making sure the original intent of test is maintained
* Whenver we cant use state delay signature calculation and use source file version as signature
* Incremental correctness checks
* Retain old behavior in compile on save by disabling use of file version as signature in when state is not reused
* Revert "Revert "Editor support for link tag (#41877)" (#43302)"
This reverts commit 451d4354b9.
* Fix parsing @link at end of comment
* Parse comments as string when no @link occurs
* fix lint
* Initial scribbles
* Compiles but provides spans instead of location pairs
Probably need to fork the services/server types and provide a conversion
with Session.toFileSpan. Not sure where to put the conversion.
* Switch to DocumentSpan
In theory this is already better supported, but not sure practise bears
that out.
* Builds w/protocol types + conversions
* cleanup:better names and scrub TODOs
* fix test harness too
* Misc
1. Simplify protocol after talking to @mjbvz.
2. Add more tests.
3. Initial notes about where to add parsing.
* Parse and store links in the compiler
The text of the link is still stored in the comment text, but that's now
kept in an object instead of just a string. Each link has the parse for
the entity reference, if there is one.
Needs lots more tests -- this just makes all the existing jsdoc tests
pass.
* more tests and some fixes
* Fix other failing tests
* fix bad merge
* polish parser
* improve names and array types
* slight tweaks
* remove some done TODOs
* more tests + resulting fixes
* add+fix cross-module tests
* Support `@see {@link`
Plus find-all-refs support equivalent to @see's.
* add server test
* Make comments actually part of the AST
* Add span for link.name in language service/protocol
* Make checker optional in getJSDocTags
Also change to JSDocCommentText from JSDocCommentComment
* Use getTokenValue instead of getTokenText
Measure twice, slice once
* Add missing support for top-level links
The language service and protocol were missing support for top-level
links. This commit adds that plumbing.
* add string back to comment type in node constructors
* Full parse of link tags and jsdoc comment text
- Doesn't pass fourslash yet, I'm going to switch to baselines for
failures there.
- Still needs some work on the protocol to convert file+offset to
file+line+offset.
* fix lint
* Fix missing newlines in inferFromUsage codefix
* Parse jsdoc comments as text node/link array
And switch to line+character offsets in the protocol
* Fix fourslash tests
Mostly ones that can't be baselined, but I switched a couple more over
to baselines
* Improve types and documentation
* Test+fix @link emit, scrub other TODOs
* update API baselines
* test that goto-def works with @link
* Split link displaypart into 3
One for link prefix and suffix, one for link name, and one for link
text.
* update baselines
* Provide JSDocTagInfo.text: string to full clients by default
Instead of upgrading them to displayparts.
* Real server tests
* Disambiguate {@link} and @param x {type}
They are ambiguous; previously the parser preferred the type
interpretation, but will now look ahead and parse links instead when the
prefix is `{@link`.
* Add explanatory comment in test
* fix location in richResponse in protocol
* update API baseline
* Address PR comments
1. Add a cross-file goto-def test.
2. Switch from per-message args to UserPreference.
* use arraysEqual from core
* Test update
* Use source file version as default signature for the file whenever there is no dts emit for the file
* json source files from project reference should be able to calculate the signature
* Dont emit declaration map when emitting dts files for force emit for signature
* Use ids as 1 based so we can specialize `0` to be some special meaning
* Baseline tsbuildinfo size in the readable baseline
* Baseline fileName and fileNames list as well in readable tsbuildinfo so that new additions are easy to recognize
* Baseline readable buildinfo
* Use file names as index in file name list
This is extension of the idea given by @sokra to optimize size of tsbuildinfo
* Deduplicate reference map lists and use file name index to sort them
Different implementation of #43079 based on idea suggested by @sokra
* Minimal json.stringify for the tsbuildinfo
Again implementaion of suggestion by @sokra
* Update src/testRunner/unittests/tsbuild/helpers.ts
Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
* Readable version of buildinfo all the time
* Some renames for readability as per feedback
Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
* fix receiver of imported and exported functions
fixes: #35420
* Rebase against master and clean up substitution flow
* Add evaluator tests
* Fix evaluator tests
Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>