Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing declaration, type definition, and references functionality #156

Open
3 tasks done
per1234 opened this issue May 9, 2023 · 0 comments
Open
3 tasks done

Missing declaration, type definition, and references functionality #156

per1234 opened this issue May 9, 2023 · 0 comments
Assignees
Labels
type: imperfection Perceived defect in any part of project

Comments

@per1234
Copy link
Contributor

per1234 commented May 9, 2023

Describe the problem

The Eclipse Theia IDE framework (as of 1.37.0) includes the following language server-dependent features:

  • Go to Declaration / Peek Declaration
  • Go to Type Definition / Peek Type Definition
  • Go to References / Peek References

🐛 None of these are functional in the Arduino IDE sketch editor.

To reproduce

  1. Start Arduino IDE.

  2. Select File > Advanced > Keyboard Shortcuts from the Arduino IDE menus.

  3. Configure keyboard shortcuts for the following commands:

    • editor.action.revealDeclaration
    • editor.action.goToTypeDefinition
    • editor.action.goToReferences

    Keyboard shortcuts are used in this demo because the editor context menu items for the non-functional language server features were removed from Arduino IDE: chore: Theia 1.37.0 arduino-ide#2027 (comment)

  4. Create a sketch with the following content:

    enum foo_t {bar};
    foo_t baz();
    foo_t baz() {
      return bar;
    }
    void setup() {
      baz();
    }
    void loop() {}
  5. Select Tools > Board > Arduino AVR Boards > Arduino Uno from the Arduino IDE menus.

  6. Wait for the the "indexing" process to finish, as indicated at the left side of the status bar.

  7. Place the cursor on the baz function call on line 7 of the sketch editor.

  8. Press the keyboard shortcut for the "editor.action.revealDefinition" command (Ctrl+F12 by default).

  9. Select "Go to Declaration" from the context menu.
    🙂 The cursor moves to the baz function definition at line 3 as expected.
    This step demonstrates that other language server-dependent features are functional.

  10. Place the cursor on the baz function call on line 7.

  11. Press the keyboard shortcut for the "editor.action.revealDeclaration" command
    🐛 Nothing happens (expected result is that the cursor would move to the baz function declaration at line 2)

  12. Place the cursor on the foo_t function return type on line 2.

  13. Press the keyboard shortcut for the "editor.action.goToTypeDefinition" command
    🐛 Nothing happens (expected result is that the cursor would move to the foo_t type definition at line 1)

  14. Place the cursor on the baz function declaration on line 2.

  15. Press the keyboard shortcut for the "editor.action.goToReferences" command
    🐛 Nothing happens (expected result is that a peek would open with all references to baz)

Expected behavior

Arduino Language Server provides Arduino IDE with whatever it needs to make these features functional.

Arduino Language Server version

0.7.4

Arduino CLI version

0.32.2

Operating system

  • Windows
  • Linux
  • macOS

Operating system version

  • Windows 11
  • Ubuntu 22.04
  • macOS Ventura

Additional context

The demo works as expected when using VS Code.


Logs generated by performing the above procedure with the build from arduino/arduino-ide@36e2092:

NonFunctionalLSFeatures.zip

Related

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

3 participants