Skip to content
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

Fake workspace symbol search by sending requests to project of all open documents. #11026

Closed
dbaeumer opened this issue Aug 26, 2016 · 7 comments
Assignees
Labels
feature-request Request for new features or functionality typescript Typescript support issues verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@dbaeumer
Copy link
Member

No description provided.

@dbaeumer
Copy link
Member Author

Was busy adoption TS 2.0.3. This has to wait a little.

@dbaeumer dbaeumer assigned waderyan and unassigned dbaeumer Nov 15, 2016
@dbaeumer dbaeumer added the feature-request Request for new features or functionality label Nov 15, 2016
@dbaeumer
Copy link
Member Author

@waderyan at the end it would make more sense to ask the TS team to implement that. They know all open projects and files.

@dbaeumer dbaeumer modified the milestones: Backlog, November 2016 Dec 6, 2016
@waderyan waderyan assigned mjbvz and unassigned waderyan Jul 13, 2017
@mjbvz
Copy link
Collaborator

mjbvz commented Sep 7, 2017

TS API request: microsoft/TypeScript#2530

@mjbvz
Copy link
Collaborator

mjbvz commented Apr 24, 2020

Added with a new setting: typescript.workspaceSymbols.scope. Valid values are:

  • allOpenProjects — (default) search all opened projects for symbols. Requires TS 3.9+
  • currentProject — Only search the current project

To verify, in the VS Code codebase open TS code in an extension and in core. Then try the following:

  • If you are using TS 3.9, all projects should be searched by default
  • On older TS versions, only the current project should be searched.
    If using TS 3.9, you can switch to only search the current project by setting: "typescript.workspaceSymbols.scope": "currentProject"

@bpasero
Copy link
Member

bpasero commented Apr 24, 2020

Gave it a try but seeing this:

RR <semantic> TypeScript Server Error (3.9.0-dev.20200420)
Cannot read property 'replace' of undefined
TypeError: Cannot read property 'replace' of undefined
    at normalizeSlashes (tsserver.js:6284:21)
    at Object.normalizePath (tsserver.js:6393:16)
    at Object.toNormalizedPath (tsserver.js:140919:23)
    at ProjectService.getScriptInfo (tsserver.js:145375:67)
    at IOSession.Session.getProjects (tsserver.js:148070:45)
    at IOSession.Session.getFullNavigateToItems (tsserver.js:148584:84)
    at IOSession.Session.getNavigateToItems (tsserver.js:148552:33)
    at Session.handlers.ts.createMapFromTemplate._a.<computed> (tsserver.js:147376:61)
    at tsserver.js:148931:88
    at IOSession.Session.executeWithRequestId (tsserver.js:148922:28)
    at IOSession.Session.executeCommand (tsserver.js:148931:33)
    at IOSession.Session.onMessage (tsserver.js:148955:35)
    at Interface.<anonymous> (tsserver.js:150271:27)
    at Interface.emit (events.js:203:13)
    at Interface._onLine (readline.js:316:10)
    at Interface._normalWrite (readline.js:461:12)
    at Socket.ondata (readline.js:172:10)
    at Socket.emit (events.js:203:13)
    at addChunk (_stream_readable.js:295:12)
    at readableAddChunk (_stream_readable.js:276:11)
    at Socket.Readable.push (_stream_readable.js:210:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:166:17): Error: <semantic> TypeScript Server Error (3.9.0-dev.20200420)
Cannot read property 'replace' of undefined
TypeError: Cannot read property 'replace' of undefined
    at normalizeSlashes (tsserver.js:6284:21)
    at Object.normalizePath (tsserver.js:6393:16)
    at Object.toNormalizedPath (tsserver.js:140919:23)
    at ProjectService.getScriptInfo (tsserver.js:145375:67)
    at IOSession.Session.getProjects (tsserver.js:148070:45)
    at IOSession.Session.getFullNavigateToItems (tsserver.js:148584:84)
    at IOSession.Session.getNavigateToItems (tsserver.js:148552:33)
    at Session.handlers.ts.createMapFromTemplate._a.<computed> (tsserver.js:147376:61)
    at tsserver.js:148931:88
    at IOSession.Session.executeWithRequestId (tsserver.js:148922:28)
    at IOSession.Session.executeCommand (tsserver.js:148931:33)
    at IOSession.Session.onMessage (tsserver.js:148955:35)
    at Interface.<anonymous> (tsserver.js:150271:27)
    at Interface.emit (events.js:203:13)
    at Interface._onLine (readline.js:316:10)
    at Interface._normalWrite (readline.js:461:12)
    at Socket.ondata (readline.js:172:10)
    at Socket.emit (events.js:203:13)
    at addChunk (_stream_readable.js:295:12)
    at readableAddChunk (_stream_readable.js:276:11)
    at Socket.Readable.push (_stream_readable.js:210:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:166:17)
	at Function.create (/Users/bpasero/Development/Microsoft/monaco/extensions/typescript-language-features/out/tsServer/serverError.js:19:16)
	at ProcessBasedTsServer.dispatchResponse (/Users/bpasero/Development/Microsoft/monaco/extensions/typescript-language-features/out/tsServer/server.js:143:70)
	at ProcessBasedTsServer.dispatchMessage (/Users/bpasero/Development/Microsoft/monaco/extensions/typescript-language-features/out/tsServer/server.js:85:30)
	at /Users/bpasero/Development/Microsoft/monaco/extensions/typescript-language-features/out/tsServer/server.js:58:45
	at Emitter.fire (/Users/bpasero/Development/Microsoft/monaco/out/vs/base/common/event.js:457:42)
	at Reader.onLengthData (/Users/bpasero/Development/Microsoft/monaco/extensions/typescript-language-features/out/utils/wireProtocol.js:112:30)
	at Socket.<anonymous> (/Users/bpasero/Development/Microsoft/monaco/extensions/typescript-language-features/out/utils/wireProtocol.js:91:42)
	at Socket.emit (events.js:203:13)
	at addChunk (_stream_readable.js:295:12)
	at readableAddChunk (_stream_readable.js:276:11)
	at Socket.push (_stream_readable.js:210:10)
	at Pipe.onStreamRead (internal/stream_base_commons.js:166:17)

@mjbvz
Copy link
Collaborator

mjbvz commented Apr 24, 2020

You need to be on the latest TS nightly for this. The one we have in our workspace isn't recent enough. I'll should pick up the next TS build before the insiders build with this change goes out

@bpasero
Copy link
Member

bpasero commented Apr 24, 2020

Got it 👍

@roblourens roblourens added the verified Verification succeeded label Apr 29, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jun 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality typescript Typescript support issues verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants