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

Feature - disable extension on per-file basis to mitigate Unresolved reference: errors #567

Open
spaceunifyfifty opened this issue Mar 13, 2024 · 2 comments

Comments

@spaceunifyfifty
Copy link

spaceunifyfifty commented Mar 13, 2024

From my research it looks that the extension still does not support code from third party dependencies like JUnit or KMP. Examples #487, #101 The code successfully compiles and executes, but I have VSCode visually alerting me with red errors everywhere. I want to tell the extension to ignore certain files or sets of files where libraries are imported and used. I can tolerate not having autocompletion and hints in a few minority sections of my codebase while getting to benefit from the extension in the vanilla kotlin majority of cases. But currently it looks like my only options are to totally remove your extension and have no ide support for the language or use your extension but be limited from using any libraries if I don't want red squiggles everywhere.

@fwcd
Copy link
Owner

fwcd commented Mar 13, 2024

From my research it looks that the extension still does not support code from third party dependencies like JUnit or KMP.

It should support that, but only if your project follows a standard Maven/Gradle layout. If it does not, you could create a kls-classpath script to tell it where to find the corresponding JARs.

But currently it looks like my only options are to totally remove your extension and have no ide support for the language or use your extension but be limited from using any libraries if I don't want red squiggles everywhere.

If you "just" want to disable errors (and still get code completion etc.), you can also set "kotlin.diagnostics.enabled": false, but that will disable them everywhere. This is a more of a feature of last resort to make the language support somewhat usable even if the language server cannot resolve all dependencies correctly.

Ignoring specific files is still to be implemented, it has come up every now and then (see e.g. the discussion in #560).

@spaceunifyfifty
Copy link
Author

I looked at the classpath example, and I'm not really sure what it would look like for example, a project that uses the ktor library? Where is that located?

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

No branches or pull requests

2 participants