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

Workspace symbol picker is empty on a Typescript project #4916

Closed
sgoodluck opened this issue Nov 28, 2022 · 2 comments
Closed

Workspace symbol picker is empty on a Typescript project #4916

sgoodluck opened this issue Nov 28, 2022 · 2 comments
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug

Comments

@sgoodluck
Copy link

sgoodluck commented Nov 28, 2022

Summary

May be related to #4910

Reproduction Steps

Open a typescript project on the root and nav to any typescript file

space-s shows symbols in the current file as expected.

space-S shows empty instead of symbols across projects.

Video below:
https://asciinema.org/a/sdwt2Alwt8fr921B2mrmm3uFx

This repros whether I'm outside the correct directory or within it (See video navigating directories)

Helix log

~/.cache/helix/helix.log
2022-11-27T20:39:07.513 helix_view::clipboard::provider [WARN] No clipboard provider found! Yanking and pasting will be internal to Helix
2022-11-27T20:39:09.457 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{"textDocument":{"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"completion":{"completionItem":{"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]},"snippetSupport":false},"completionItemKind":{}},"hover":{"contentFormat":["markdown"]},"publishDiagnostics":{},"rename":{"dynamicRegistration":false,"honorsChangeAnnotations":false,"prepareSupport":false},"signatureHelp":{"signatureInformation":{"activeParameterSupport":true,"documentationFormat":["markdown"],"parameterInformation":{"labelOffsetSupport":true}}}},"window":{"workDoneProgress":true},"workspace":{"applyEdit":true,"configuration":true,"didChangeConfiguration":{"dynamicRegistration":false},"symbol":{"dynamicRegistration":false},"workspaceFolders":true}},"processId":6255,"rootPath":"/home/seth/Projects/impact-management-api","rootUri":"file:///home/seth/Projects/impact-management-api","workspaceFolders":[{"name":"impact-management-api","uri":"file:///home/seth/Projects/impact-management-api"}]},"id":0}
2022-11-27T20:39:09.866 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"[lspserver] Using Typescript version (workspace) 4.7.4 from path \"/home/seth/Projects/impact-management-api/node_modules/typescript/lib/tsserver.js\""}}
2022-11-27T20:39:09.866 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":0,"result":{"capabilities":{"textDocumentSync":2,"completionProvider":{"triggerCharacters":[".","\"","'","/","@","<"],"resolveProvider":true},"codeActionProvider":{"codeActionKinds":["source.fixAll.ts","source.removeUnused.ts","source.addMissingImports.ts","source.organizeImports.ts","quickfix","refactor"]},"definitionProvider":true,"documentFormattingProvider":true,"documentRangeFormattingProvider":true,"documentHighlightProvider":true,"documentSymbolProvider":true,"executeCommandProvider":{"commands":["_typescript.applyWorkspaceEdit","_typescript.applyCodeAction","_typescript.applyRefactoring","_typescript.configurePlugin","_typescript.organizeImports","_typescript.applyRenameFile","_typescript.goToSourceDefinition"]},"hoverProvider":true,"inlayHintProvider":true,"renameProvider":true,"referencesProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",",","<"],"retriggerCharacters":[")"]},"workspaceSymbolProvider":true,"implementationProvider":true,"typeDefinitionProvider":true,"foldingRangeProvider":true,"semanticTokensProvider":{"documentSelector":null,"legend":{"tokenTypes":["class","enum","interface","namespace","typeParameter","type","parameter","variable","enumMember","property","function","member"],"tokenModifiers":["declaration","static","async","readonly","defaultLibrary","local"]},"full":true,"range":true},"callsProvider":true}}}
2022-11-27T20:39:09.866 helix_lsp::transport [INFO] <- {"capabilities":{"callsProvider":true,"codeActionProvider":{"codeActionKinds":["source.fixAll.ts","source.removeUnused.ts","source.addMissingImports.ts","source.organizeImports.ts","quickfix","refactor"]},"completionProvider":{"resolveProvider":true,"triggerCharacters":[".","\"","'","/","@","<"]},"definitionProvider":true,"documentFormattingProvider":true,"documentHighlightProvider":true,"documentRangeFormattingProvider":true,"documentSymbolProvider":true,"executeCommandProvider":{"commands":["_typescript.applyWorkspaceEdit","_typescript.applyCodeAction","_typescript.applyRefactoring","_typescript.configurePlugin","_typescript.organizeImports","_typescript.applyRenameFile","_typescript.goToSourceDefinition"]},"foldingRangeProvider":true,"hoverProvider":true,"implementationProvider":true,"inlayHintProvider":true,"referencesProvider":true,"renameProvider":true,"semanticTokensProvider":{"documentSelector":null,"full":true,"legend":{"tokenModifiers":["declaration","static","async","readonly","defaultLibrary","local"],"tokenTypes":["class","enum","interface","namespace","typeParameter","type","parameter","variable","enumMember","property","function","member"]},"range":true},"signatureHelpProvider":{"retriggerCharacters":[")"],"triggerCharacters":["(",",","<"]},"textDocumentSync":2,"typeDefinitionProvider":true,"workspaceSymbolProvider":true}}
2022-11-27T20:39:09.867 helix_term::application [INFO] window/logMessage: LogMessageParams { typ: Info, message: "[lspserver] Using Typescript version (workspace) 4.7.4 from path \"/home/seth/Projects/impact-management-api/node_modules/typescript/lib/tsserver.js\"" }
2022-11-27T20:39:09.867 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"initialized","params":{}}
2022-11-27T20:39:09.868 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"languageId":"typescript","text":"import express, { Application, NextFunction, Request, Response } from 'express';\nimport cors from 'cors';\nimport * as swaggerUi from 'swagger-ui-express';\nimport { auth } from 'express-oauth2-jwt-bearer';\nimport configLoader from '@App/configLoader.js';\nimport spec from '@App/resources/spec.json' assert { type: 'json' };\nimport { BaseConfig, Problem, ResponseError } from '@App/resources/types.js';\nimport * as OpenApiValidator from 'express-openapi-validator';\nimport grantRoutes from './routes/grants.js';\nimport permissionRoutes from './routes/permissions.js';\nimport healthRoutes from './routes/health.js';\nimport programRoutes from './routes/programs.js';\n\nconst router = express.Router();\nconst app: Application = express();\nconst loadedConfig: BaseConfig = configLoader.loadConfig();\n\nconst allowedOrigins = [\n  'http://localhost:1234',\n  'https://ims.dev.apps.futurestech.cloud',\n];\n\nconst options: cors.CorsOptions = {\n  origin: allowedOrigins,\n};\n\nconst errorHandler = (\n  err: ResponseError,\n  req: Request,\n  res: Response,\n  next: NextFunction, // eslint-disable-line @typescript-eslint/no-unused-vars\n) => {\n  const problem: Problem = {\n    title: err.title,\n    detail: err.detail,\n    status: err.status,\n    type: err.type,\n    instance: err.instance,\n  };\n\n  if (err.errors) {\n    // This is an open api error we need to catch\n    problem.detail = err.stack;\n    problem.title = 'Open API Validation Error';\n    problem.errors = err.errors;\n  }\n\n  res.status(problem.status || 500).json(problem);\n};\n\n/**\n * Sets url query parsing to simple mode\n */\napp.set('query parser', 'simple');\n\n/**\n * Instruct app to use CORS json body parser\n */\napp.use(cors(options));\napp.use(express.json());\n\n/**\n * Health check endpoint\n */\nrouter.get('/health', healthRoutes);\n\n/**\n * Swagger UI documentation endpoint\n */\nrouter.use('/docs', swaggerUi.serve);\nrouter.get('/docs', swaggerUi.setup(spec));\n\n/**\n * Sets openapi-validator middleware\n */\napp.use(\n  OpenApiValidator.middleware({\n    apiSpec: 'src/resources/spec.json',\n    validateRequests: true,\n    validateApiSpec: true,\n    validateResponses: true,\n    ignorePaths: /(\\/docs)|(\\/health)/,\n  }),\n);\n\n/**\n * Sets the app to use router and auth\n */\napp.use(router);\napp.use(auth(loadedConfig.auth));\n\n/**\n * NOTE: Routes below this point will require auth\n */\napp.use('/permissions', permissionRoutes);\napp.use('/grants', grantRoutes);\napp.use('/programs', programRoutes);\n\n/**\n * Set app to use general error handler and port\n */\napp.use(errorHandler);\napp.set('port', loadedConfig.port);\n\nexport default app;\n","uri":"file:///home/seth/Projects/impact-management-api/src/app.ts","version":0}}}
2022-11-27T20:39:10.908 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/documentSymbol","params":{"textDocument":{"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts"}},"id":1}
2022-11-27T20:39:11.534 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":0,"method":"window/workDoneProgress/create","params":{"token":"139decf6-30bd-4039-b848-986434920031"}}
2022-11-27T20:39:11.535 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","result":null,"id":0}
2022-11-27T20:39:11.536 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"$/progress","params":{"token":"139decf6-30bd-4039-b848-986434920031","value":{"kind":"begin","title":"Initializing JS/TS language features…"}}}
2022-11-27T20:39:11.536 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"$/progress","params":{"token":"139decf6-30bd-4039-b848-986434920031","value":{"kind":"end"}}}
2022-11-27T20:39:11.548 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":1,"result":[{"name":"allowedOrigins","kind":14,"location":{"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts","range":{"start":{"line":17,"character":6},"end":{"line":20,"character":1}}}},{"name":"apiSpec","kind":7,"location":{"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts","range":{"start":{"line":77,"character":4},"end":{"line":77,"character":38}}}},{"name":"app","kind":14,"location":{"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts","range":{"start":{"line":14,"character":6},"end":{"line":14,"character":34}}}},{"name":"default","kind":14,"location":{"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts","range":{"start":{"line":104,"character":0},"end":{"line":104,"character":19}}}},{"name":"errorHandler","kind":14,"location":{"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts","range":{"start":{"line":26,"character":6},"end":{"line":48,"character":1}}}},{"name":"problem","kind":14,"location":{"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts","range":{"start":{"line":32,"character":8},"end":{"line":38,"character":3}}},"containerName":"errorHandler"},{"name":"detail","kind":7,"location":{"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts","range":{"start":{"line":34,"character":4},"end":{"line":34,"character":22}}},"containerName":"problem"},{"name":"instance","kind":7,"location":{"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts","range":{"start":{"line":37,"character":4},"end":{"line":37,"character":26}}},"containerName":"problem"},{"name":"status","kind":7,"location":{"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts","range":{"start":{"line":35,"character":4},"end":{"line":35,"character":22}}},"containerName":"problem"},{"name":"title","kind":7,"location":{"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts","range":{"start":{"line":33,"character":4},"end":{"line":33,"character":20}}},"containerName":"problem"},{"name":"type","kind":7,"location":{"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts","range":{"start":{"line":36,"character":4},"end":{"line":36,"character":18}}},"containerName":"problem"},{"name":"ignorePaths","kind":7,"location":{"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts","range":{"start":{"line":81,"character":4},"end":{"line":81,"character":38}}}},{"name":"loadedConfig","kind":14,"location":{"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts","range":{"start":{"line":15,"character":6},"end":{"line":15,"character":58}}}},{"name":"options","kind":14,"location":{"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts","range":{"start":{"line":22,"character":6},"end":{"line":24,"character":1}}}},{"name":"origin","kind":7,"location":{"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts","range":{"start":{"line":23,"character":2},"end":{"line":23,"character":24}}},"containerName":"options"},{"name":"router","kind":14,"location":{"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts","range":{"start":{"line":13,"character":6},"end":{"line":13,"character":31}}}},{"name":"validateApiSpec","kind":7,"location":{"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts","range":{"start":{"line":79,"character":4},"end":{"line":79,"character":25}}}},{"name":"validateRequests","kind":7,"location":{"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts","range":{"start":{"line":78,"character":4},"end":{"line":78,"character":26}}}},{"name":"validateResponses","kind":7,"location":{"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts","range":{"start":{"line":80,"character":4},"end":{"line":80,"character":27}}}}]}
2022-11-27T20:39:11.549 helix_lsp::transport [INFO] <- [{"kind":14,"location":{"range":{"end":{"character":1,"line":20},"start":{"character":6,"line":17}},"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts"},"name":"allowedOrigins"},{"kind":7,"location":{"range":{"end":{"character":38,"line":77},"start":{"character":4,"line":77}},"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts"},"name":"apiSpec"},{"kind":14,"location":{"range":{"end":{"character":34,"line":14},"start":{"character":6,"line":14}},"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts"},"name":"app"},{"kind":14,"location":{"range":{"end":{"character":19,"line":104},"start":{"character":0,"line":104}},"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts"},"name":"default"},{"kind":14,"location":{"range":{"end":{"character":1,"line":48},"start":{"character":6,"line":26}},"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts"},"name":"errorHandler"},{"containerName":"errorHandler","kind":14,"location":{"range":{"end":{"character":3,"line":38},"start":{"character":8,"line":32}},"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts"},"name":"problem"},{"containerName":"problem","kind":7,"location":{"range":{"end":{"character":22,"line":34},"start":{"character":4,"line":34}},"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts"},"name":"detail"},{"containerName":"problem","kind":7,"location":{"range":{"end":{"character":26,"line":37},"start":{"character":4,"line":37}},"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts"},"name":"instance"},{"containerName":"problem","kind":7,"location":{"range":{"end":{"character":22,"line":35},"start":{"character":4,"line":35}},"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts"},"name":"status"},{"containerName":"problem","kind":7,"location":{"range":{"end":{"character":20,"line":33},"start":{"character":4,"line":33}},"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts"},"name":"title"},{"containerName":"problem","kind":7,"location":{"range":{"end":{"character":18,"line":36},"start":{"character":4,"line":36}},"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts"},"name":"type"},{"kind":7,"location":{"range":{"end":{"character":38,"line":81},"start":{"character":4,"line":81}},"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts"},"name":"ignorePaths"},{"kind":14,"location":{"range":{"end":{"character":58,"line":15},"start":{"character":6,"line":15}},"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts"},"name":"loadedConfig"},{"kind":14,"location":{"range":{"end":{"character":1,"line":24},"start":{"character":6,"line":22}},"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts"},"name":"options"},{"containerName":"options","kind":7,"location":{"range":{"end":{"character":24,"line":23},"start":{"character":2,"line":23}},"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts"},"name":"origin"},{"kind":14,"location":{"range":{"end":{"character":31,"line":13},"start":{"character":6,"line":13}},"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts"},"name":"router"},{"kind":7,"location":{"range":{"end":{"character":25,"line":79},"start":{"character":4,"line":79}},"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts"},"name":"validateApiSpec"},{"kind":7,"location":{"range":{"end":{"character":26,"line":78},"start":{"character":4,"line":78}},"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts"},"name":"validateRequests"},{"kind":7,"location":{"range":{"end":{"character":27,"line":80},"start":{"character":4,"line":80}},"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts"},"name":"validateResponses"}]
2022-11-27T20:39:11.585 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts","diagnostics":[]}}
2022-11-27T20:39:11.764 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/seth/Projects/impact-management-api/src/app.ts","diagnostics":[{"range":{"start":{"line":28,"character":2},"end":{"line":28,"character":5}},"message":"'req' is declared but its value is never read.","severity":4,"code":6133,"source":"typescript"},{"range":{"start":{"line":30,"character":2},"end":{"line":30,"character":6}},"message":"'next' is declared but its value is never read.","severity":4,"code":6133,"source":"typescript"}]}}
2022-11-27T20:39:13.896 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"workspace/symbol","params":{"query":""},"id":2}
2022-11-27T20:39:13.898 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":2,"result":[]}
2022-11-27T20:39:13.898 helix_lsp::transport [INFO] <- []
2022-11-27T20:39:24.564 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"shutdown","params":null,"id":3}
2022-11-27T20:39:24.566 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":3,"result":null}
2022-11-27T20:39:24.566 helix_lsp::transport [INFO] <- null
2022-11-27T20:39:24.567 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"exit","params":null}

Platform

Linux

Terminal Emulator

kitty

Helix Version

helix 22.08.1

@sgoodluck sgoodluck added the C-bug Category: This is a bug label Nov 28, 2022
@the-mikedavis
Copy link
Member

Looks like the same issue except that the empty query is rejected within typescript's internal systems instead of the language server directly, according to typescript-language-server/typescript-language-server#108

#3110 should fix this as well.

@the-mikedavis the-mikedavis added the A-helix-term Area: Helix term improvements label Nov 28, 2022
@the-mikedavis the-mikedavis linked a pull request Nov 28, 2022 that will close this issue
2 tasks
@sgoodluck
Copy link
Author

Looks like the same issue except that the empty query is rejected within typescript's internal systems instead of the language server directly, according to typescript-language-server/typescript-language-server#108

#3110 should fix this as well.

Confirmed. I pulled down #3110 and built it.
As an FYI, nothing appears until after I start typing.

Will update #3110 in the notes. Closing this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants