AvinZarlez / processing-vscode

A Visual Studio Code extension for the programming language Processing
https://marketplace.visualstudio.com/items?itemName=Tobiah.language-pde
MIT License
177 stars 25 forks source link

[BUG] PGraphics.resetMatrix() replaced with translate(x, y, z) by Intellisense #102

Open ndesprez opened 3 years ago

ndesprez commented 3 years ago

Bug description When pressing TAB after typing resetM, "resetMatrix()" appears in the predictive keyword list but when TAB is pressed, the text is replaced by "translate(x, y, z)".

To Reproduce Steps to reproduce the behavior:

  1. Type "resetM"
  2. Press TAB

Expected behavior resetM should be replaced by resetMatrix().

VSCode

AvinZarlez commented 2 years ago

This extension does not provide intellisense. It does however provide snippets.

The relavent snippet:

    "resetMatrix": {
        "prefix": "resetMatrix",
        "body": "translate(${1:x}, ${2:y}, ${3:z});",
        "description": "resetMatrix",
        "scope": "source.pde"
    },

I got those snippets definitions a long time ago from the sublime package https://github.com/b-g/processing-sublime/blob/a1bc61861024060572ea0be9e79a4f6ac471de20/Snippets/resetMatrix.sublime-snippet

It's been forever since I used processing so not sure why the commend is that way in the sublime snippet (and thus here)

If it is supposed to be resetMatrix, it would be as simple as changing to:

    "resetMatrix": {
        "prefix": "resetMatrix",
        "body": "resetMatrix()",
        "description": "resetMatrix",
        "scope": "source.pde"
    },

Can you think of a reason why it would be the other way? Otherwise, I can fix this when I get around to making the next version release

ndesprez commented 2 years ago

Hi Tobias. Thanks for your reply. There's no reason why resetMatrix() should be replaced with a translate(). Your proposed correction seems good to me.