Skip to content

Conversation

@amcasey
Copy link
Member

@amcasey amcasey commented Jan 23, 2018

Otherwise, keywords are accepted. Assert was

fail (e:\ts_gh\src\compiler\core.ts:2867)
assert (e:\ts_gh\src\compiler\core.ts:2837)
isExportSpecifierAlias (e:\ts_gh\src\services\findAllReferences.ts:931)
getLocalSymbolForExportSpecifier
(e:\ts_gh\src\services\findAllReferences.ts:926)
skipPastExportOrImportSpecifierOrUnion
(e:\ts_gh\src\services\findAllReferences.ts:411)
getReferencedSymbolsForSymbol
(e:\ts_gh\src\services\findAllReferences.ts:359)
getReferencedSymbolsForNode
(e:\ts_gh\src\services\findAllReferences.ts:271)
getReferenceEntriesForNode
(e:\ts_gh\src\services\findAllReferences.ts:91)
getSemanticDocumentHighlights
(e:\ts_gh\src\services\documentHighlights.ts:25)
getDocumentHighlights (e:\ts_gh\src\services\documentHighlights.ts:13)
getDocumentHighlights (e:\ts_gh\src\services\services.ts:1584)
getOccurrencesAtPositionCore (e:\ts_gh\src\services\services.ts:1588)
getOccurrencesAtPosition (e:\ts_gh\src\services\services.ts:1567)
Session.getOccurrences (e:\ts_gh\src\server\session.ts:718)
Session.handlers.ts.createMapFromTemplate._a.(anonymous function)
(e:\ts_gh\src\server\session.ts:1999)
(anonymous function) (e:\ts_gh\src\server\session.ts:2079)
Session.executeWithRequestId (e:\ts_gh\src\server\session.ts:2069)
Session.executeCommand (e:\ts_gh\src\server\session.ts:2079)
Session.onMessage (e:\ts_gh\src\server\session.ts:2101)
(anonymous function) (e:\ts_gh\src\server\server.ts:593)

Otherwise, keywords are accepted. Assert was

```
fail (e:\ts_gh\src\compiler\core.ts:2867)
assert (e:\ts_gh\src\compiler\core.ts:2837)
isExportSpecifierAlias (e:\ts_gh\src\services\findAllReferences.ts:931)
getLocalSymbolForExportSpecifier
(e:\ts_gh\src\services\findAllReferences.ts:926)
skipPastExportOrImportSpecifierOrUnion
(e:\ts_gh\src\services\findAllReferences.ts:411)
getReferencedSymbolsForSymbol
(e:\ts_gh\src\services\findAllReferences.ts:359)
getReferencedSymbolsForNode
(e:\ts_gh\src\services\findAllReferences.ts:271)
getReferenceEntriesForNode
(e:\ts_gh\src\services\findAllReferences.ts:91)
getSemanticDocumentHighlights
(e:\ts_gh\src\services\documentHighlights.ts:25)
getDocumentHighlights (e:\ts_gh\src\services\documentHighlights.ts:13)
getDocumentHighlights (e:\ts_gh\src\services\services.ts:1584)
getOccurrencesAtPositionCore (e:\ts_gh\src\services\services.ts:1588)
getOccurrencesAtPosition (e:\ts_gh\src\services\services.ts:1567)
Session.getOccurrences (e:\ts_gh\src\server\session.ts:718)
Session.handlers.ts.createMapFromTemplate._a.(anonymous function)
(e:\ts_gh\src\server\session.ts:1999)
(anonymous function) (e:\ts_gh\src\server\session.ts:2079)
Session.executeWithRequestId (e:\ts_gh\src\server\session.ts:2069)
Session.executeCommand (e:\ts_gh\src\server\session.ts:2079)
Session.onMessage (e:\ts_gh\src\server\session.ts:2101)
(anonymous function) (e:\ts_gh\src\server\server.ts:593)
```
@amcasey amcasey requested review from a user and RyanCavanaugh January 23, 2018 23:53
@@ -0,0 +1,11 @@
/// <reference path='fourslash.ts'/>

// @Filename: file1.ts
Copy link

Choose a reason for hiding this comment

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

File name isn't needed unless you're doing a test with multiple files, or an unusual file extension.

Copy link
Member Author

Choose a reason for hiding this comment

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

Neat.

@@ -0,0 +1,11 @@
/// <reference path='fourslash.ts'/>
Copy link

Choose a reason for hiding this comment

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

This doesn't seem document-highlights specific, so would probably be better as findAllRefsReExports3.ts. Then you could use verify.noReferences instead of adding a noDocumentHighlights method.

Copy link
Member Author

Choose a reason for hiding this comment

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

I wrote a FAR test to confirm that it covers this change. I don't mind submitting it as well, but I think it's worthwhile to keep this test because (1) the scenario does not appear to have other test coverage, (2) it seems like there ought to be at least one test asserting that certain points in the code don't have reference highlighting.

@amcasey amcasey merged commit 0297289 into microsoft:master Feb 1, 2018
@amcasey amcasey deleted the HighlightingAssert branch February 1, 2018 18:11
@microsoft microsoft locked and limited conversation to collaborators Jul 3, 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.

1 participant