profelis / daScript-plugin

daScript language support
https://marketplace.visualstudio.com/items?itemName=profelis.dascript-plugin
MIT License
9 stars 4 forks source link

It seems that constants and enums are optimized,so cant jump to defined line #16

Closed zle000 closed 7 months ago

zle000 commented 7 months ago

··· enum eEnumData eData1 eData2 let man = 100 [export] def main() var bro = man + 100 var eData = eEnumData eData1 ··· the eData1 and man in main(),can't found hover info and jump to definition,
May I change some config or compilation options to make it work ? ):

profelis commented 7 months ago

Hi! answer is same, like in https://github.com/profelis/daScript-plugin/issues/14 You need usage of variable, or compiler can drop it fully. Immutable global variables (constants) can be inlined too.

Where is an option options no_optimizations = true, but it doesn't help here, because majority of this optimization are made in infer phase, before optimizer really works.

zle000 commented 6 months ago

Hi! answer is same, like in #14 You need usage of variable, or compiler can drop it fully. Immutable global variables (constants) can be inlined too.

Where is an option options no_optimizations = true, but it doesn't help here, because majority of this optimization are made in infer phase, before optimizer really works.

I find a options optimize = false, this make the enum and const have code hover info showing ):

profelis commented 6 months ago

I find a options optimize = false, this make the enum and const have code hover info showing ):

Be careful, this option slows down your code