Pure-D / serve-d

D LSP server (dlang language server protocol server)
MIT License
206 stars 48 forks source link

Don't show empty lines if DMDImport Timing is enabled but doesn't work #91

Open Cogitri opened 4 years ago

Cogitri commented 4 years ago

It appears that if DMDImport Timing is enabled but doesn't work (e.g. if one doesn't use dmd, I suppose) Code-D inserts lines to display the timing information but since that can't be generated these lines stay empty:

image

It'd be nicer if Code-D generated an error message and didn't generate these empty newlines which look kind of odd.

WebFreak001 commented 4 years ago

as per LSP API it is only possible to provide locations for code lenses (the import timings) and then only later on fill them.

It's like this because otherwise the code would jump around if it would resolve them randomly and you would probably misclick somewhere if you clicked while it was resolving or it would be distracting while coding.

I think the blank lines while it is loading is not such an issue. Rather it should be investigated why it doesn't work for you there.

It's disabled by default because measuring the import timing is a blocking task so no other tasks (like auto completion or linting) are running during it, which could affect user experience. I don't think it's the most useful feature now because the import times can differ significantly between runs, making it not very useful to even check timings between each other in relation to each other.

Cogitri commented 4 years ago

Rather it should be investigated why it doesn't work for you there.

I suppose it works only if dmd is available? I only have ldc2 available. Anyway, I can just disable the feature for now.

WebFreak001 commented 4 years ago

yep that's the issue, that's why it's called "dmdImportTiming" :p

Cogitri commented 4 years ago

Yup, expected that, I guess that setting could check for dmd then though?