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

added diagnostics and removed code lens #4

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

typhonshambo
Copy link
Owner

  • The Vs-code extension now uses the diagnostics feature in order to display the outputs and suggestions, this code works on existing API response :

Sample response :

{
  "style_guide" {
    "issues" : [
      {
        "line": 1,
        "message": "IndentationError: unexpected indent.  At least one space needed after 'def' keyword."
      },
      {
        "line": 2,
        "message": "IndentationError: unexpected indent.  Docstring content should start at 4 spaces indentation."
      },
      {
        "line": 4,
        "message": "IndentationError: unexpected indent.  Code inside function should be indented by 4 spaces."
      },
      {
        "line": 6,
        "message": "IndentationError: unindent does not match any outer indentation level."
      }
    ]
  }
}

- The Vs-code extension now uses the diagnostics feature in order to display the outputs and suggestions, this code works on existing API response :

Sample response :
```Json

[
  {
    "line": 1,
    "message": "IndentationError: unexpected indent.  At least one space needed after 'def' keyword."
  },
  {
    "line": 2,
    "message": "IndentationError: unexpected indent.  Docstring content should start at 4 spaces indentation."
  },
  {
    "line": 4,
    "message": "IndentationError: unexpected indent.  Code inside function should be indented by 4 spaces."
  },
  {
    "line": 6,
    "message": "IndentationError: unindent does not match any outer indentation level."
  }
]
```
@typhonshambo typhonshambo linked an issue Jul 6, 2024 that may be closed by this pull request
@typhonshambo typhonshambo self-assigned this Jul 6, 2024
@typhonshambo typhonshambo added the enhancement New feature or request label Jul 6, 2024
@typhonshambo
Copy link
Owner Author

typhonshambo commented Jul 6, 2024

  • Need to update the API response so that it only highlights the specific keyword not the line

typhonshambo and others added 4 commits July 7, 2024 23:32
Update formatting to prevent linting errors
- now response includes `severity`, `start_char`, `end_char` for more detailed highlighting
- Migrated from gemini-1.5-pro to gemini-1.5-flash as it was taking long response time, and was not providing accurate API response.
- Now extension only highlights the required part of code not the whole line
- Severity Label added
@typhonshambo
Copy link
Owner Author

typhonshambo commented Jul 9, 2024

The highlighting of specific keywords works fine, but the the start_char and end_char seems not to be accurate in API response. Due to this it's highlighting wrong places

@typhonshambo typhonshambo added the help wanted Extra attention is needed label Jul 12, 2024
typhonshambo and others added 4 commits July 12, 2024 20:32
- FastAPI is better in terms of logging and handling
- Extension folder is now modulated for easy maintenance and feature implementation
- The code is now send to API in the form of a Array where every item in the Array is a line of code. This will enhance the prediction of start_char and end_char by Gemini
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using diagnostics rather than Code lens
2 participants