withastro / language-tools

Language tools for Astro
MIT License
240 stars 45 forks source link

🐛 BUG: Go to problems after version 2.9.0 #876

Open zanhk opened 1 month ago

zanhk commented 1 month ago

Describe the Bug

System: windows vscode: 1.89.1 (latest)

Some version of the extension have problems with the go to

Extension version recap: 2.8.6: Go to works correctly 2.9.0 to 2.9.1: Go to does nothing 2.10.0 to 2.10.2: Go to open a non-existing file .0.mts

my vscode settings

{
    "css.customData": [".vscode/tailwind.json"],
    "workbench.editor.labelFormat": "short",
    "workbench.tree.indent": 16,
    "workbench.editor.highlightModifiedTabs": true,
    "workbench.editor.limit.enabled": true,
    "workbench.editor.limit.perEditorGroup": true,
    "workbench.editor.limit.value": 7,
    "files.defaultLanguage": "${activeEditorLanguage}",
    "files.trimTrailingWhitespace": true,
    "files.autoGuessEncoding": true,
    "files.insertFinalNewline": true,
    "editor.suggestSelection": "first",
    "editor.tabCompletion": "on",
    "editor.detectIndentation": false,
    "editor.insertSpaces": false,
    "editor.acceptSuggestionOnEnter": "off",
    "editor.defaultFormatter": "biomejs.biome",
    "editor.linkedEditing": true,
    "editor.inlineSuggest.enabled": true,
    "editor.wordSeparators": "`~!@%^&*()-=+[{]}\\|;:'\",.<>/?",
    "editor.bracketPairColorization.enabled": true,
    "editor.bracketPairColorization.independentColorPoolPerBracketType": true,
    "editor.acceptSuggestionOnCommitCharacter": false,
    "editor.guides.bracketPairs": true,
    "editor.inlayHints.enabled": "offUnlessPressed",
    "editor.minimap.enabled": false,
    "editor.cursorBlinking": "solid",
    "editor.gotoLocation.multipleDefinitions": "goto",
    "editor.gotoLocation.multipleTypeDefinitions": "goto",
    "editor.gotoLocation.multipleDeclarations": "goto",
    "editor.gotoLocation.multipleImplementations": "goto",
    "editor.gotoLocation.multipleReferences": "goto",
    "terminal.integrated.copyOnSelection": true,
    "terminal.integrated.defaultProfile.windows": "Command Prompt",
    "terminal.integrated.enableMultiLinePasteWarning": "never",
    "explorer.incrementalNaming": "smart",
    "explorer.compactFolders": false,
    "debug.openDebug": "openOnDebugBreak",
    "debug.allowBreakpointsEverywhere": true,
    "javascript.updateImportsOnFileMove.enabled": "always",
    "typescript.updateImportsOnFileMove.enabled": "always",
    "typescript.inlayHints.parameterNames.enabled": "all",
    "extensions.ignoreRecommendations": true,
    "emmet.triggerExpansionOnTab": true,
    "references.preferredLocation": "view",
    "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
    "json.schemaDownload.enable": true,
    "livePreview.notifyOnOpenLooseFile": false,
    "livePreview.customExternalBrowser": "Chrome",
    "livePreview.debugOnExternalPreview": true,
    "tailwindCSS.emmetCompletions": true,
    "tailwindCSS.validate": true,
    "tailwindCSS.classAttributes": ["class", "className", "ngClass", "class:list"],
    "cSpell.language": "en,it",
    "cSpell.diagnosticLevel": "Information",
    "[astro]": {
        "editor.defaultFormatter": "astro-build.astro-vscode"
    }
}

Steps to Reproduce

tested in a empty project adding

<script>
    var a = 1;
</script>
johnsoncodehk commented 1 month ago

tested in a empty project adding

<script>
  var a = 1;
</script>

Hi @zanhk, could you provide the complete code for this section?

zanhk commented 1 month ago

@johnsoncodehk I ll upload the entire repo, but it's just the default astro minimal template with that script, the script it's irrelevant, the problem happen doing goto in any script variable

zanhk commented 1 month ago

@johnsoncodehk Here a video where I reproduce the problem

google_screen_recording_2024-05-26T13-29_58.951Z.webm

and a repo if you need, but as said it happen with every script

https://github.com/zanhk/astro-goto-problems

johnsoncodehk commented 1 month ago

This issue may have been fixed at https://github.com/volarjs/services/commit/873bba318ba07df75a27291e98a4c2150216beed.

This is the install package for #879, could you check if the problem still exists?

astro-vscode-2.10.2-volar-2.3.vsix.zip

zanhk commented 1 month ago

Hi @johnsoncodehk, yes with that package the problem still persist

zanhk commented 1 month ago

I also have a different problem, when i work on react projects I need to disable this extension because somehow it override the behaviours of "ctrl + click"

In my preferences I setted "Go to source definition" as preferred

image

WIth the extension installed it does a "Go to definition" instead.

google_screen_recording_2024-06-04T08-23_40.452Z.webm

Shouldn't this be active only on astro file?