Git Product home page Git Product logo

language-scala's Introduction

language-scala's People

Contributors

50wliu avatar aminya avatar cowa avatar evacchi avatar gangstead avatar jeroanan avatar jroesch avatar lee-dohm avatar mahmoudkassem avatar markbahnman avatar masseguillaume avatar mcous avatar pleira avatar spencern avatar tpolecat avatar trepidacious avatar wbazant avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

language-scala's Issues

Incorrect matching of operator identifiers

This is slightly complicated, and I'm still working through the scala spec. etc. to work out what should happen, but probably an example is the best place to start:

In grammars/scala.cson there is:

'match': '(==?|!=|<=|>=|<>|<|>)'
'name': 'keyword.operator.comparison.scala'

This matches === as == then =, which is incorrect - the whole === is a function name, defined by say scalaz as an improved comparison.

In fact == itself isn't really a keyword, it's also a method, with an "operator identifier" consisting of symbols.

Since methods aren't assigned a style, it would seem to be the correct behaviour to just get rid of these matches, and leave ==, ===, >= etc. unstyled?

To work properly the following would also need fixing:

'match': '(<-|←|->|→|=>|⇒|\\?|\\:+|@|\\|)+'
'name': 'keyword.operator.scala'

Since this will catch stuff like >=>, which I think is a valid function or variable name, not a => keyword. I've had a quick look at what could be done to avoid catching this, and it might look something like:

   'captures':
     '2':
       'name': 'keyword.operator.scala'
   'match': '([^!#%&*+\-/:<=>?@\\^|~])(<-|←|->|→|=>|⇒|\\?|\\:+|@|\\|)+([^!#%&*+\-/:<=>?@\\^|~])'

This requires that there is a non-operator character both before and after the keyword. Since operator identifiers need to contain only operator OR alphanumeric characters I think this should work reasonably well. However it's definitely not completely correct since there are more operator characters - unicode mathematical symbols etc., and there's something to do with using an underscore between operator characters and alphanumerics. There's more here: http://stackoverflow.com/questions/7656937/valid-identifier-characters-in-scala

On a side-note, the keyword.operator.comparison.scala match above also catches =, which is a keyword but not comparison?

I ran into this while using fira code to get nice ligatures for stuff like <- and => - when you type === it gets broken up into two spans for styling, so you don't get the "triple equals" ligature, but a "double equals" ligature then a normal equals sign. The same thing affects other ligatures like '<=<'.

I've submitted a pull request for this, it may not be usable directly but should show approximately what I mean...

Package.loadSettings is deprecated.

Store package settings files in the settings/ directory instead of scoped-properties/

Package.loadSettings (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:566:9)
<unknown> (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:168:43)
Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:147:15)
Package.load (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:161:12)

Contributors

Hello, @jroesch.

It does not look like you interested in supporting this repo. Maybe you will add collaborators and share instructions to publish package?

Thanks.

Syntax highlight bug: '\r'|'\n'

This (slimmed down) function:

def consume (c : Char) {
  state =
    (state,c) match {
      case (HeaderLine(ln),'\r'|'\n') => { processHeaderLine(ln) ; NextLine(""+c) }
    }
}

renders as this:

image

Adding spaces like '\r' | '\n' fixes the issue.

Syntax highlighting breaks when nesting

Atom 1.8.0
language-scala 1.1.6

screen shot 2016-07-18 at 1 21 45 pm

The first right-bracket shows highlights correctly, but all right brackets after the first closing bracket are not highlighted.

Package.loadSettings is deprecated.

Store package settings files in the settings/ directory instead of scoped-properties/

Package.loadSettings (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:582:9)
<unknown> (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:184:43)
Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:163:15)
Package.load (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:177:12)
PackageManager.loadPackage (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:355:14)
PackageManager.loadPackages (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:325:14)

single quote render error

Hi! Probably it is related to #36 fix - unfortunately can not say as far as didn't see the error shown on the attached image before package update.
atom-scala-apos 2

Scala Code Comment highlighting in green to end of document if Equals not followed by a Space

I think this issue might be reported with different triggers.

I did not see this particular trigger so I've added a new request in the hopes that it help clarify the problem(s).

I suspect that when one falls the rest will follow :)

Then again I'm an optimist...

In a line of Scala with an equals sign the "green -- ergo this is a comment" colouring goes to the end of the document IF the equals does not have a space after it.

atom -v
Atom    : 1.19.5
Electron: 1.6.9
Chrome  : 56.0.2924.87
Node    : 7.4.0

Sample one with space: GOOD

GOOD

Sample two without a space: BAD

BAD

Package.loadSettings is deprecated.

Store package settings files in the settings/ directory instead of scoped-properties/

Package.loadSettings (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:566:9)
<unknown> (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:168:43)
Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:147:15)
Package.load (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:161:12)

Changelog

Having a changelog.md is important for users to know what changed in terms of API, feature additions, bug fixes, performance changes, feature additions, etc.

Package.loadSettings is deprecated.

Store package settings files in the settings/ directory instead of scoped-properties/

Package.loadSettings (/Applications/Atom.app/Contents/Resources/app/src/package.js:565:9)
<unknown> (/Applications/Atom.app/Contents/Resources/app/src/package.js:187:43)

Comments within type parameters break highlighting

I'm not sure how exactly to fix this, but having an inline block comment that happens to be in a type parameter seems to break the syntax highlighting.

I'm converting some code, whereby I'm removing a type parameter. I've simply commented out the specific type parameter, but the comment is not highlighted correctly.

Normal one line block comments are fine:

def foo(x: Int) = { /* this works */ 5 }

But the following breaks:

def foo[S,/*F[_]:Foldable,*/ A](x: Int) = 5

I've narrowed it down to the [ which changes the pattern, causing the highlight to not work.

Ligature not triggered on squiggly arrow

This is an oddly specific issue, and just a minor annoyance, but if I've understood correctly, it traces back to the syntax theme (see tonsky/FiraCode#63).

The issue is that ~> is not turned into its ligature when using Fira Code, which generally means it has been broken up into two tokens (e.g., because of spans).

Is it possible to make it so that ~> characters are consecutive so that the ligature may trigger ?

Package.loadSettings is deprecated.

Store package settings files in the settings/ directory instead of scoped-properties/

Package.loadSettings (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:582:9)
<unknown> (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:184:43)
Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:163:15)
Package.load (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:177:12)
PackageManager.loadPackage (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:355:14)
PackageManager.loadPackages (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:325:14)

Package.loadSettings is deprecated.

Store package settings files in the settings/ directory instead of scoped-properties/

Package.loadSettings (/usr/share/atom/resources/app.asar/src/package.js:566:9)
<unknown> (/usr/share/atom/resources/app.asar/src/package.js:168:43)
Package.measure (/usr/share/atom/resources/app.asar/src/package.js:147:15)
Package.load (/usr/share/atom/resources/app.asar/src/package.js:161:12)

Support for s-prefixed strings

Strings that are prefixed with an s aren’t recognised by the parser and it makes the rest of the file appear as a string.

screen shot 2015-02-17 at 17 46 31

Regression in v1.1.9

One of the two merged in v1.1.9 pull-requests: #52 or #42 broke something.

I'm using Scala grammar when working with the Play Twirl templates. It's a mix of HTML and Scala code, but as Scala highlights XML tags, it generally worked fine with Scala grammar. But in the last update something broke:

screen shot 2017-08-11 at 14 24 12

Here's how it looked with v1.1.8:

screen shot 2017-08-11 at 14 30 14

Package.loadSettings is deprecated.

Store package settings files in the settings/ directory instead of scoped-properties/

Package.loadSettings (C:\Users\Lucena\AppData\Local\atom\app-0.190.0\resources\app\src\package.js:550:9)
<unknown> (C:\Users\Lucena\AppData\Local\atom\app-0.190.0\resources\app\src\package.js:172:43)

Package.loadSettings is deprecated.

Store package settings files in the settings/ directory instead of scoped-properties/

Package.loadSettings (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:566:9)
<unknown> (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:168:43)
Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:147:15)
Package.load (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:161:12)

Package.loadSettings is deprecated.

Store package settings files in the settings/ directory instead of scoped-properties/

Package.loadSettings (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:566:9)
<unknown> (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:168:43)
Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:147:15)
Package.load (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:161:12)

Package.loadSettings is deprecated.

Store package settings files in the settings/ directory instead of scoped-properties/

Package.loadSettings (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:566:9)
<unknown> (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:168:43)
Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:147:15)
Package.load (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:161:12)

Package.loadSettings is deprecated.

Store package settings files in the settings/ directory instead of scoped-properties/

Package.loadSettings (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:586:9)
<unknown> (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:188:43)
Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:167:15)
Package.load (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:181:12)

Syntax highlight bug: `/*`()

The following code gets highlighted incorrectly:

def `/*`() = ()
`/*`()

The second /* is being treated as if it were the start of a block comment, even though it's inside backticks.

Demo.

This exact same bug is present in the Scala TextMate bundle (mads-hartmann/scala.tmbundle/issues/58), which is currently used by Linguist, so you'll see the same problem in the code block above.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.