Skip to content

Language server doesn't work on newly created non-.ino files #93

Closed
@per1234

Description

@per1234

Describe the bug

When a tab is created for a .cpp, .c, or .h file, no language server capabilities work in it. It only starts working after closing and reopening the sketch or changing the board selection.

To Reproduce

  1. Open a sketch in the Arduino IDE.
  2. Click the downward pointing triangle button on the right side of the tab bar.
  3. Select "New Tab" from the menu.
  4. In the "Name for new file" field, type foo.cpp.
  5. Click the OK button.
  6. Add some code to the foo.cpp tab that should produce some reaction from the language server. For example, this code:
    asdf
    should produce a red squiggly underline.
    Note that there is no language server capabilities in the file.
  7. Close the sketch.
  8. Open the sketch again.
    Note that the language server capabilities are now working as expected in foo.cpp.

Expected behavior

Language Server capabilities work in all types of sketch code files from creation on.

Desktop

  • OS: Windows 10
  • Arduino IDE Version: 2.0.0-rc2
    Date: 2021-12-13T10:09:39.122Z
    CLI Version: 0.20.2 [13783819]

Additional context

The issue does not occur when using Arduino Language Server version 0.5.0-rc2

Logs:
LSnew.zip

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions