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

JS: Handle meta-properties new.target and import.meta and improve code completion with newlines and comments #7211

Merged
merged 4 commits into from
Apr 10, 2024

Commits on Mar 30, 2024

  1. JS: Enable parsing import.meta (meta property) in addition to new.tar…

    …get (already supported)
    
    Parsing was modified to report 'new.target' as an AccessNode on an
    IdentNode 'new' with property 'target'. 'import.meta' is modelled
    identically.
    matthiasblaesing committed Mar 30, 2024
    Configuration menu
    Copy the full SHA
    170c1e3 View commit details
    Browse the repository at this point in the history
  2. JS: Ensure lexer and parser have similar interpretation of new.target…

    … and import.meta
    
    The JS parser reports new.target as an AccessNode for the property
    "target" on the IdentNode "new". The parser has no KeyWord Node, else
    that would be the best choice.
    
    The lexer lexes new.target as three tokens:
    
    - Keyword "new"
    - Operator "."
    - Identifier "target"
    matthiasblaesing committed Mar 30, 2024
    Configuration menu
    Copy the full SHA
    86be3c4 View commit details
    Browse the repository at this point in the history

Commits on Mar 31, 2024

  1. JS: Provide model data for meta properties new.target and import.meta

    Both new.target and import.meta are declared as special properties with
    special semantic as they are properties on keywords. The approach taken
    here is to declare a helper object "metaproperties", declare the "new"
    and "import" properties and their children there. After parsing the
    properties are relocated from metaproperties into the global object,
    where they will be picked up by the JsCompletion.
    matthiasblaesing committed Mar 31, 2024
    Configuration menu
    Copy the full SHA
    bb2d43f View commit details
    Browse the repository at this point in the history
  2. JS: Improve completion for property chain (obj.prop1.prop2) with embe…

    …dded comments and new lines
    matthiasblaesing committed Mar 31, 2024
    Configuration menu
    Copy the full SHA
    9766a62 View commit details
    Browse the repository at this point in the history