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

Kotlin files in dot directories not indexed #294

Closed
tekumara opened this issue Jun 28, 2021 · 2 comments · Fixed by #560
Closed

Kotlin files in dot directories not indexed #294

tekumara opened this issue Jun 28, 2021 · 2 comments · Fixed by #560
Labels
bug Something isn't working

Comments

@tekumara
Copy link

Teamcity kotlin files typically live in .teamcity/.

Example:

$ git clone https://github.com/tekumara/teamcity-kotlin-example
$ tree -a teamcity-kotlin-example
teamcity-kotlin-example
....
└── .teamcity
    ├── common.kt
    ├── pom.xml
    └── settings.kts

When I open teamcity-kotlin-example/ in vscode, the Kotlin LS doesn't add the teamcity kotlin files to the source path:

[Info  - 6:38:39 PM] main      Adding script definitions [ScriptTemplateWithArgs]
[Info  - 6:38:39 PM] main      Kotlin Language Server: Version 1.1.1
[Info  - 6:38:39 PM] main      Connected to client
[Info  - 6:38:39 PM] async0    Adding workspace folder teamcity-kotlin-example
[Info  - 6:38:40 PM] async0    Adding 0 files under /tmp/teamcity-kotlin-example to source path
...

And therefore Go to Definition, hover etc. in settings.kts doesn't work, eg: on line 39 open class BaseBuildType() : BuildType()

Other scenarios:

  1. open teamcity-kotlin-example/.teamcity in vscode. The kotlin files will be indexed, but I can no longer work on the other files in the repository at the same time.
  2. rename .teamcity/ to teamcity/ and open the root folder (ie: teamcity-kotlin-example/). The Kotlin LS correctly adds the files to the source path on startup:
[Info  - 8:56:12 PM] async0    Adding workspace folder teamcity-kotlin-example
[Info  - 8:56:12 PM] async0    Adding .../teamcity/common.kt, .../teamcity/settings.kts under /tmp/teamcity-kotlin-example to source path

vscode extension: fwcd.kotlin v0.2.22

@tekumara
Copy link
Author

NB: A multi-root workspace which adds .teamcity as a separate root does get around this, but is a little inconvenient and non-obvious for newcomers.

@fwcd fwcd transferred this issue from fwcd/vscode-kotlin Jun 28, 2021
@fwcd fwcd added the bug Something isn't working label Jun 28, 2021
@tony-sol
Copy link
Contributor

tony-sol commented Feb 21, 2024

Looks like (just guessing), that the root cause is here - https://github.com/fwcd/kotlin-language-server/blob/main/shared/src/main/kotlin/org/javacs/kt/SourceExclusions.kt#L17 in excluding ".*" pattern.

LS can't find any source files if they're in hidden directories.

Am i right?

UPD: i believe it was made to ignore .git, .svn, .hg or any other unrelated directories, but unfortunately, there are also related ones.

@fwcd fwcd closed this as completed in #560 Mar 8, 2024
fwcd added a commit that referenced this issue Mar 8, 2024
Fixes #294 - selectively exclude hidden directories
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants