Skip to content

Conversation

AlexandrosAlexiou
Copy link
Contributor

@AlexandrosAlexiou AlexandrosAlexiou commented Sep 27, 2025

Abstract:
The LSP has the capability to resolve packages to system paths. When executing a go to definition command on a package we can use this capability in the VSCode plugin.

This PR prevents VSCode from showing "file is not displayed because it is a directory"
errors when Kotlin LSP navigation points to package directories. Instead,
automatically opens the Explorer view and highlights the target directory.

  • Override editor.action.revealDefinition for Kotlin files only
  • Check if definition targets are directories vs files
  • Open directories in Explorer, handle files normally
  • Maintain existing behavior for non-Kotlin files

PS.
I have added this feature to kotlin.nvim as well, so I supplied this patch for the VSCode plugin for uniformity, let me know if this is something you would like to add to the project.

Thanks!

@AlexandrosAlexiou AlexandrosAlexiou force-pushed the feat/kotlin-directory-navigation-interceptor branch 3 times, most recently from d420fb0 to 7265aea Compare September 27, 2025 18:11
…xplorer

Prevents VSCode from showing "file is not displayed because it is a
directory"
errors when Kotlin LSP navigation points to package directories.
Instead,
automatically opens the Explorer view and highlights the target
directory.

- Override editor.action.revealDefinition for Kotlin files only
- Check if definition targets are directories vs files
- Open directories in Explorer, handle files normally
- Maintain existing behavior for non-Kotlin files
@AlexandrosAlexiou AlexandrosAlexiou force-pushed the feat/kotlin-directory-navigation-interceptor branch from 7265aea to 2c57754 Compare September 27, 2025 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant