Skip to content

Fix various bugs and allow api keyword#17

Open
ahsand97 wants to merge 1 commit intowhoami730:cythonV2from
ahsand97:cythonV2
Open

Fix various bugs and allow api keyword#17
ahsand97 wants to merge 1 commit intowhoami730:cythonV2from
ahsand97:cythonV2

Conversation

@ahsand97
Copy link
Copy Markdown

Cyright module — PR description

Summary

Adds Cython api keyword support in the parser and type system, and wires the Cython extension settings (cython.typeCheckingMode, cython.includePaths) into the language server.


Commit

  • bccdab3cf — Fix various bugs and allow api keyword

Changes

1. Cython api keyword

  • tokenizerTypes.ts — New KeywordType.Api, added to varModifiers and softKeywords so api is accepted where public is (e.g. cdef public api void foo()).
  • tokenizer.ts — Map 'api'KeywordType.Api.
  • parseNodes.ts — Add CTypeNode.isApi(node) (same pattern as isPublic).
  • types.ts — Add isApi?: boolean to CythonDetails; set it in cloneForCType from CTypeNode.isApi(node).
  • typePrinter.ts — When printing types, add 'api' to the modifier list when details.isApi.
  • completionProvider.ts — Add 'api' to the Cython keyword list for completions.

2. Cython configuration

  • configOptions.ts — Support typeCheckingMode === 'cython' and use a Cython-specific diagnostic rule set (e.g. getCythonDiagnosticRuleSet()).
  • server.ts — Read cython.typeCheckingMode and cython.includePaths from the cython config section; default typeCheckingMode to 'cython' when running as the Cython extension.

References

Copy link
Copy Markdown
Owner

@whoami730 whoami730 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Can you explain Fix various bugs in the title?
  • And can we consider having tests please?

return diagSettings;
}

/** Cython: minimal diagnostics — only syntax/parse errors. Suppresses import and undefined-variable noise for .pyx/.pxd. */
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we consider adding a TODO here?

@ahsand97
Copy link
Copy Markdown
Author

  • Can you explain Fix various bugs in the title?

    • And can we consider having tests please?

Yes, the various bugs are referenced here whoami730/cython-enhanced#14 basically a bunch of false positive syntax errors and also this other specific bug ktnrg45/vs-code-cython#36.

And yes, I'll be adding tests too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants