Skip to content

Chained methods and properties on expressions #107

Open

Description

@vors

Moving from SublimeText/PowerShell#68
And SublimeText/PowerShell#77

Environment

  • Editor and Version (VS Code, Atom, Sublime): Sublime
  • Your primary theme: Default

Issue Description

There is inconsistency in the chained methods:

$users.Split(",").Trim()

Split and Trim get 2 different regions.

Same applies for

$foo.bar

vs

($foo).bar

Screenshots

image

Expected Behavior

  • Trim() and Split() should be the same region type
  • .bar in first and second case should be the same region type

Code Samples

$users.Split(",").Trim()

$foo.bar
($foo).bar

Activity

  1. keith-hall commented on May 31, 2018

    @keith-hall
    Contributor

    even disregarding the chaining, scoping $variable.anything as an entity.name.function.invocation is very wrong - invocations should never get an entity scope, as they show up in the symbol list. The . should be punctuation.accessor.dot and the identifier afterwards in this case is not a function, just a property, so variable.other.member would suffice. If it were a function, variable.function would be appropriate.

  2. omniomi commented on May 31, 2018

    @omniomi
    Contributor

    Keith Hall (@keith-hall) you'll find a lot of scoping issues and one of the overarching projects is going to be to review them all. As best as possible I am following https://www.sublimetext.com/docs/3/scope_naming.html; However, I am not a developer so I don't always know what a particular thing in the syntax is fundamentally called and referencing other languages that may also be scoped incorrectly doesn't always help. I have a decent idea but there are gaps.

    So far I've fixed some of them, I've left some of them the way they were for the time being, and in at least one instance I set one incorrectly on purpose to meet user expectation across 99% of themes until the actual patterns could be redefined.

    One of the issues with the PS syntax file as it stands is that a number of things are defined in pieces with no connections even when directly related. That means you cannot assign a proper parent or meta scope for fallback when themes don't cover one of the more granular scopes. One of my goals is to fix a lot of those issues (variables and function calls are top of the list right now) but some scopes are incorrect for the time being for that reason.

    This discussion from 2016 is still open: #8 but it may be worth starting it from scratch at this point.

  3. added a commit that references this issue on Jun 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions