Is there a refactoring extension?

Is there an extension that implements refactoring, navigation and lint features like rename variable, go to definition and highlight undefined variable? I couldn’t find anything in community extensions or using a search engine.

I’m working on a new language and wrote a language-specific undefined variable linter before realising it might have been better done as a language-agnostic extension driven by language-specific languageData.

It feels like you could get quite a lot of functionality with some syntax tree matching rules. If anyone has already tried this, some pointers to your work (even if incomplete) would be really useful, thanks.

1 Like

A linting extension exists, but not queried via language data (because linting tends to be a whole-document thing starting at the top, rather than contextual). Lint diagnostics may include a ‘actions’, which are simply functions called for its side effect, that can be used for refactoring hints. There’s no built-in support for refactoring beyond that.

1 Like

Thanks Marijn. I’m using the linting extension already to display the diagnostics - it works well. I’ll try to abstract my existing code into a reusable form and report back if I come up with something potentially useful.