Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Dollar should be part of identifiers #33

Open

Description

@PhiLhoSoft

I opened a similar issue for JavaScript: atom/language-javascript#374

Frankly, I dont use Atom to edit Java code, I use Eclipse instead. Given the low number of issues here, either I am not alone, or you are very good... 😛

OK, let's repeat the gist of the previous issue:

Atom 1.7.3, Windows 7, although the latter is probably not relevant...

AFAIK, $ is part of the valid characters in identifiers, like underscore. Yet it is treated as a foreign punctuation character in many features of Atom.
Examples:

  • Double click to select the identifier: the $ isn't selected (if prefix or suffix) or stops the selection (in the middle).
  • Word move with Ctrl+Left / Right arrow: stops on $
  • Search log with Whole Word option: selects the log part of $log.
  • If an identifier has a $ in its middle, the part after the $ is highlighted differently.

I know that Sun recommended not to use $ in identifiers, keeping this usage for themselves, but yet it is a valid char, and should be treated as such.

Activity

  1. noseglid commented on Jun 28, 2016

    @noseglid
    Contributor

    Variables with $ is correctly highlighted now.

    Correct me if I'm wrong, but I don't think the "double-click" or ctrl-left to jump words is managed by the languages. @50Wliu ?
    If not than this can be closed.

  2. PhiLhoSoft commented on Jun 28, 2016

    @PhiLhoSoft
    Author

    Correct me if I'm wrong, but I don't think the "double-click" or ctrl-left to jump words is managed by the languages

    If not, it is a problem (with Atom itself) / they should be: these operations are based on the concept of "words", and this concept is tightly related to the language: $ is a good example here (valid in JS / Java, not in some other languages), but in other languages (CSS for example) dash is also part of identifiers (words), and so on. Idem for Unicode characters.

  3. noseglid commented on Jun 28, 2016

    @noseglid
    Contributor

    @PhiLhoSoft I totally agree. It should be part of the language definition. But as it is now, the rest of this issue (aside from highlighting) does not belong to this repo (if that is so).

    In CSS, stuff like dashes in e.g. border-top behave the same way as how you're describing $ in java.

  4. PhiLhoSoft commented on Jun 29, 2016

    @PhiLhoSoft
    Author

    That's annoying, but indeed, if that's beyond your scope, please feel free to close the issue if you fixed what was within your reach.

  5. winstliu commented on Jul 15, 2016

    @winstliu
    Contributor

    Correct me if I'm wrong, but I don't think the "double-click" or ctrl-left to jump words is managed by the languages. @50Wliu ?

    It actually is. editor.nonWordCharacters can be modified by languages (and I have a local branch changing that). I think the Find and Replace "whole word" regex can't be changed though.

  6. noseglid commented on Jul 15, 2016

    @noseglid
    Contributor

    Cool, thanks for the correction!

  7. PhiLhoSoft commented on Aug 26, 2016

    @PhiLhoSoft
    Author

    I haven't understood the comment of @50Wliu until today, thanks to the comment atom/language-javascript#374 (comment)
    So, we can at least fix that ourselves. Might be nice to be the default, though.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions