Closed lapega closed 1 year ago
Should work. Provide a project that reproduces or at least provide the output of LSP: Troubleshoot Server command.
(didn't know how to provide a project)
## Server Configuration
- command
```json
[
"${node_bin}",
"${server_path}",
"--stdio"
]
/usr/local/bin/node "/home/pgauna/.cache/sublime-text/Package Storage/LSP-typescript/16.16.0/typescript-language-server/node_modules/typescript-language-server/lib/cli.mjs" --stdio
source.js, source.jsx, source.ts, source.tsx
source.js, source.jsx, source.ts, source.tsx
{
"completionDisableFilterText": true,
"disableAutomaticTypingAcquisition": false,
"locale": "en",
"maxTsServerMemory": 0,
"npmLocation": "",
"plugins": [],
"preferences": {
"allowIncompleteCompletions": true,
"allowRenameOfImportPath": true,
"allowTextChangesInNewFiles": true,
"autoImportFileExcludePatterns": [],
"disableSuggestions": false,
"displayPartsForJSDoc": true,
"generateReturnInDocTemplate": true,
"importModuleSpecifierEnding": "auto",
"importModuleSpecifierPreference": "shortest",
"includeAutomaticOptionalChainCompletions": true,
"includeCompletionsForImportStatements": true,
"includeCompletionsForModuleExports": true,
"includeCompletionsWithClassMemberSnippets": true,
"includeCompletionsWithInsertText": true,
"includeCompletionsWithObjectLiteralMethodSnippets": true,
"includeCompletionsWithSnippetText": true,
"includePackageJsonAutoImports": "auto",
"jsxAttributeCompletionStyle": "auto",
"lazyConfiguredProjectsFromExternalProject": false,
"organizeImportsAccentCollation": true,
"organizeImportsCaseFirst": false,
"organizeImportsCollation": "ordinal",
"organizeImportsCollationLocale": "en",
"organizeImportsIgnoreCase": "auto",
"organizeImportsNumericCollation": false,
"providePrefixAndSuffixTextForRename": true,
"provideRefactorNotApplicableReason": true,
"quotePreference": "auto",
"useLabelDetailsInCompletionEntries": true
},
"tsserver": {
"logDirectory": "",
"logVerbosity": "off",
"path": "",
"trace": "off",
"useSyntaxServer": "auto"
}
}
{
"diagnostics": {
"ignoredCodes": []
},
"implicitProjectConfiguration": {
"checkJs": false,
"experimentalDecorators": false,
"module": "ESNext",
"strictFunctionTypes": true,
"strictNullChecks": true,
"target": "ES2020"
},
"javascript": {
"format": {
"insertSpaceAfterCommaDelimiter": true,
"insertSpaceAfterConstructor": false,
"insertSpaceAfterFunctionKeywordForAnonymousFunctions": true,
"insertSpaceAfterKeywordsInControlFlowStatements": true,
"insertSpaceAfterOpeningAndBeforeClosingEmptyBraces": false,
"insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
"insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false,
"insertSpaceAfterSemicolonInForStatements": true,
"insertSpaceAfterTypeAssertion": false,
"insertSpaceBeforeAndAfterBinaryOperators": true,
"insertSpaceBeforeFunctionParenthesis": false,
"insertSpaceBeforeTypeAnnotation": false,
"placeOpenBraceOnNewLineForControlBlocks": false,
"placeOpenBraceOnNewLineForFunctions": false,
"semicolons": "ignore",
"trimTrailingWhitespace": true
},
"inlayHints": {
"includeInlayEnumMemberValueHints": false,
"includeInlayFunctionLikeReturnTypeHints": false,
"includeInlayFunctionParameterTypeHints": false,
"includeInlayParameterNameHints": "none",
"includeInlayParameterNameHintsWhenArgumentMatchesName": false,
"includeInlayPropertyDeclarationTypeHints": false,
"includeInlayVariableTypeHints": false,
"includeInlayVariableTypeHintsWhenTypeMatchesName": false
}
},
"statusText": "$version, $source",
"typescript": {
"format": {
"insertSpaceAfterCommaDelimiter": true,
"insertSpaceAfterConstructor": false,
"insertSpaceAfterFunctionKeywordForAnonymousFunctions": true,
"insertSpaceAfterKeywordsInControlFlowStatements": true,
"insertSpaceAfterOpeningAndBeforeClosingEmptyBraces": false,
"insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
"insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false,
"insertSpaceAfterSemicolonInForStatements": true,
"insertSpaceAfterTypeAssertion": false,
"insertSpaceBeforeAndAfterBinaryOperators": true,
"insertSpaceBeforeFunctionParenthesis": false,
"insertSpaceBeforeTypeAnnotation": false,
"placeOpenBraceOnNewLineForControlBlocks": false,
"placeOpenBraceOnNewLineForFunctions": false,
"semicolons": "ignore",
"trimTrailingWhitespace": true
},
"inlayHints": {
"includeInlayEnumMemberValueHints": false,
"includeInlayFunctionLikeReturnTypeHints": false,
"includeInlayFunctionParameterTypeHints": false,
"includeInlayParameterNameHints": "none",
"includeInlayParameterNameHintsWhenArgumentMatchesName": false,
"includeInlayPropertyDeclarationTypeHints": false,
"includeInlayVariableTypeHints": false,
"includeInlayVariableTypeHintsWhenTypeMatchesName": false
}
}
}
{
"PATH": "/usr/local/bin:/usr/local/bin:"
}
/home/pgauna/Dropbox/trabajos/unit/intranetv2/www/vista/html/_js/funciones.js
{
"auto_complete_selector": "source - (comment, string.quoted.single.php)",
"lsp_active": true,
"syntax": "Packages/JavaScript/JavaScript.sublime-syntax"
}
source.js
[
"/home/pgauna/Dropbox/trabajos/unit/intranetv2/www"
]
{
"folders": [
{
"path": "www"
}
]
}
{
"diagnostics_delay_ms": 3000,
"diagnostics_gutter_marker": "sign",
"log_debug": true,
"show_diagnostics_panel_on_save": 0
}
If your code is not written as Common JS or ES modules then Typescript doesn't really have a way to figure out references. It seems like the vista/html/_js/funciones.js
file might be just a old-school web code that references some global stuff defined in other files. This wouldn't be very TS-friendly. You'd need to either use ES modules (which would only work in modern browsers) or use ES modules and add bundler to your project to compile the code to plain JS.
Indeed, in all my projects I have a bunch of js files that are called individually. I thought that TLS-ts will look at any js file in the project.
Thanks anyway!
The "Go to definition" command only find definitions on open files (files showed in sublime tabs). If the file is closed, the message showed is "No results found".
Same thing happens with the find "References" command, only show references in open files.
This behavior doesn't happens on another LSP servers, like PHP, only happens on .js files.
I've tried reinstalling the LSP-typescript server, and also deleting user preferences, but the bug still happens.