#Code actions don't appear at first

1 messages · Page 1 of 1 (latest)

paper carbon
#

I am working on a PR to add code actions to import modules for unknown types/values and something weird is happening. Given the following file (and another where the type Wibble is defined), the code actions at first do not appear, but if I add and remove the line import wibble, the code actions appear. Does someone have a clue on what might be happening?

pub fn wibble(wobble: Wibble) -> Nil {
  Nil
}

The GitHub link is: https://github.com/mine-tech-oficial/gleam/tree/import-code-action

cobalt thunder
#

The language server has to know about a module so if you add a new one while it's running you have to import it manually once

#

It's just how it works

paper carbon
#

This came up when making some tests btw

echo blade
#

You don't need to import a module for the compiler to know about it

cobalt thunder
#

hmmm this happens to me all the time

#

might be a code is always red symptom, I mean half the lsp doesn't really work for me 😅

echo blade
#

Yup if it can't compile it it doesn't know about it

#

However if you import it then it changes the shape of the compile graph

cobalt thunder
#

the thing is it seems to start knowing some things about it if you manually import it

echo blade
#

Which probably causes it to be compiled, and since it has no errors then the compiler knows about it

cobalt thunder
#

ahhh I see

#

yeah that's definitely it, sorry

echo blade
#

np! it's not obvious

paper carbon
echo blade
#

Have it be imported by an import to force the desired compilation order

paper carbon
#

But I want to test the code actions which appear when not imported

#

(they automatically add the import)

echo blade
#

Aye, that's why it'd be imported by an import and not imported directly

paper carbon
proper sparrow
#

import wobble, and in wobble, import wibble

paper carbon
#

oh, will try it and report back