PMunch / nimlsp

Language Server Protocol implementation for Nim
MIT License
418 stars 51 forks source link

Goto definition doesn't work with modules #102

Closed AmjadHD closed 2 years ago

AmjadHD commented 2 years ago

runnig go to definition on the module

import std/stats

gives:

:: --> nimlsp textDocument/definition(139): {'position': {'character': 14, 'line': 2}, 'workDoneToken': 'wd139', 'textDocument': {'uri': 'file:///D:/dddd/AoC2021/day07/day07.nim'}}
:: <<< nimlsp 139: [{'uri': 'file:///D%3A/dddd/AoC2021/day07/day07.nim', 'range': {'end': {'character': 15, 'line': 2}, 'start': {'character': 10, 'line': 2}}}]

it just moves the caret to the start of the module name (stats)

running go to definition on the module name here:

stats.standardDeviation

does nothing

:: --> nimlsp textDocument/definition(154): {'position': {'character': 3, 'line': 7}, 'workDoneToken': 'wd154', 'textDocument': {'uri': 'file:///D:/Amjad/AoC2021/day07/day07.nim'}}
:: <<< nimlsp 154: None
AmjadHD commented 2 years ago

I guess this is a problem of nimsuggest, I tried to find the code related but I couldn't (quick search though :)), maybe you can have a look at it @PMunch ?

AmjadHD commented 2 years ago

This is now fixed and backported to 1.6.