microsoft / qsharp

Azure Quantum Development Kit, including the Q# programming language, resource estimator, and Quantum Katas
https://microsoft.github.io/qsharp/
MIT License
425 stars 86 forks source link

Fix CodeActions not working on multifile projects #1600

Closed orpuente-MS closed 4 months ago

orpuente-MS commented 4 months ago

This PR fixes CodeActions not working on multifile projects.

github-actions[bot] commented 4 months ago

Benchmark for bc763f0

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Array append evaluation | **331.2±2.32µs** | 336.5±8.93µs | **+1.60%** | | Array literal evaluation | **170.1±1.33µs** | 183.5±2.55µs | **+7.88%** | | Array update evaluation | **407.9±2.63µs** | 416.9±14.26µs | **+2.21%** | | Core + Standard library compilation | 18.8±0.34ms | 18.7±0.21ms | -0.53% | | Deutsch-Jozsa evaluation | 5.1±0.06ms | 5.1±0.06ms | 0.00% | | Large file parity evaluation | 34.1±0.10ms | 34.2±0.63ms | +0.29% | | Large input file compilation | **12.3±0.10ms** | 12.6±0.09ms | **+2.44%** | | Large input file compilation (interpreter) | **46.1±0.82ms** | 47.5±1.64ms | **+3.04%** | | Large nested iteration | **32.6±0.35ms** | 33.0±1.62ms | **+1.23%** | | Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample | 1557.0±35.48µs | 1558.2±67.85µs | +0.08% | | Perform Runtime Capabilities Analysis (RCA) on large file sample | 7.7±0.07ms | 7.7±0.08ms | 0.00% | | Perform Runtime Capabilities Analysis (RCA) on teleport sample | 1420.8±35.36µs | 1416.9±35.97µs | -0.27% | | Perform Runtime Capabilities Analysis (RCA) on the core and std libraries | 27.7±0.17ms | 27.7±0.14ms | 0.00% | | Teleport evaluation | 88.0±3.88µs | 89.4±4.25µs | +1.59% |
orpuente-MS commented 4 months ago

Does this mean we're returning a "global" SourceMap span now, instead of a file offset? If so, maybe consider removing the source_name comparison to simplify the code even further. The global spans should be all you need to compare, since they're unique across sources.

Yes, you are right! And I can avoid String comparisons that way.

github-actions[bot] commented 4 months ago

Benchmark for 87fb180

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Array append evaluation | 336.5±11.33µs | **330.9±1.63µs** | **-1.66%** | | Array literal evaluation | 183.6±1.64µs | 184.0±1.44µs | +0.22% | | Array update evaluation | 410.9±0.94µs | 410.4±1.91µs | -0.12% | | Core + Standard library compilation | 18.9±0.95ms | **18.4±0.06ms** | **-2.65%** | | Deutsch-Jozsa evaluation | 5.1±0.05ms | 5.1±0.23ms | 0.00% | | Large file parity evaluation | **34.0±0.07ms** | 34.1±0.36ms | **+0.29%** | | Large input file compilation | **12.0±0.07ms** | 12.1±0.07ms | **+0.83%** | | Large input file compilation (interpreter) | 44.4±0.45ms | 44.8±0.53ms | +0.90% | | Large nested iteration | 32.8±0.71ms | 32.8±0.24ms | 0.00% | | Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample | 1562.1±54.89µs | 1562.9±48.21µs | +0.05% | | Perform Runtime Capabilities Analysis (RCA) on large file sample | 7.7±0.12ms | **7.6±0.08ms** | **-1.30%** | | Perform Runtime Capabilities Analysis (RCA) on teleport sample | 1422.4±31.27µs | 1420.8±29.29µs | -0.11% | | Perform Runtime Capabilities Analysis (RCA) on the core and std libraries | 27.9±0.12ms | **27.7±0.18ms** | **-0.72%** | | Teleport evaluation | 89.4±3.70µs | 87.6±4.22µs | -2.01% |