Separate project and dependency sources for a target
See original GitHub issueCurrently buildTarget/dependencySources
will deliver both actual project sources / source directories and library dependency sources in one result.
However these are semantically different. Project sources are part of the actual compilation. Library sources are only used for browsing definitions or generating documentation. Editing them has no effect on the compilation output.
In the general case, it’s not possible to differentiate between project sources and library sources based on file/directory type or location. We are currently using heuristics (directory vs jar), but this is not very robust and doesn’t even cover all cases which can already be supported. For instance, in IntelliJ it’s possible to attach any directory as library sources, and the editor will be aware that it is not part of the project sources.
to be discussed for bsp 2.0
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (10 by maintainers)
Top GitHub Comments
After discussions with @jvican we came with the following proposal
buildTarget/textDocuments
buildTarget/dependencySources
buildTarget/sources
I think it would make sense to add a field
sources
inBuildTarget
given how generic this property is for any target. Then, we can delegatedependencySources
to fetch sources of project dependencies only.I’ve been thinking about merging this spec change with my proposal in https://github.com/scalacenter/bsp/issues/14 so that the demand of sources of project dependencies is always done by the client explicitly and lazily. However, I think that we should still keep this entrypoint for two reasons:
Anyhow, it’s still premature to tell. I’ll get back to this before 2.0.