Comments (16)
Noticed that a string such as @"hello" isn't highlighted properly. Need to be aware that '@' prevents escaping.
from zarchive-fsharpbinding.
Further, the single character '"'
confuses matters.
from zarchive-fsharpbinding.
A (/
incorrectly opens a multiline comment, like (*
, and it can't be closed.
from zarchive-fsharpbinding.
Simple examples of the main known issues:
// Example of typeof not highlighted
let x (y: 'a) = typeof<'a>
// Example of raw string highlighted badly
let mystring = @"hello \"
// " // Terminate string
// Example of character " highlighted badly
let mychar = '"'
// " // Terminate string
// Example of triple-quoted string highlighted badly
let mystring2 = """ hello " """
// " // Terminate string
// Example of backtick-quoted definition highlighted badly
let ``this is a definition`` () = 1
// Example of class arguments staring with a '/' causing multiline comment
type T (//
x: int) =
let f y = x
// Example of string in a comment causing it not to be highlighted as a comment
// This "should" be a comment
from zarchive-fsharpbinding.
I think the general rule is to highlight types, functions and variables where they are declared (not where they are referenced). This is how Emacs CC-Mode works, it makes sense to me, and is easier to implement. In this sense probably typeof('T) should not be highlighted, because this is not creating a type but referencing an existing type.
from zarchive-fsharpbinding.
This seems like a reasonable point of view to take re typeof
. The string quoting problems are the main thing in that case.
Replying also to https://github.com/rneatherway/fsharpbinding/pull/1#issuecomment-12635767 (let's continue discussion here):
I noticed that the .>>?
problems are transient depending on whether or not that code is followed by another definition. Regarding fsi, I think you are right and we should probably turn off highlighting there as it is quite fragile.
from zarchive-fsharpbinding.
Like I have said the "? spaces" thing is caused by these lines
;labels (and open)
;;
'("<(assert|open|include|module|namespace|extern|void)>|[~?][
(][a-z][a-zA-Z0-9']_"
;; . font-lock-variable-name-face)
I don't understand why sequences start with ? or ~ should be highlighted.
If you just want to fix this case you could simply remove the "?" in the
above regexp.
To me the biggest problem is the indenting engine. It doesn't work very
well in pattern match expressions (the next line must be indented to the
right of the "match"). eg.
let doAdd (args : list) =
args
|>List.fold (fun acc x -> match x with
| INT n -> acc + n
| _ -> failwith ("can only add INTs")) 0
|> INT
in this example, the patterns inside the lambda function has to be manually
aligned to the previous line. The indenting engine cannot handle it.
Another indenting problem is in computation expressions (such async
workflows). It simply doesn't work inside {}. This is quite annoying
because computation expression is a very important part of the F# language.
Fixing these problems requires a lot more elisp skill than tweaking regexps
and therefore has exceeded my knowledge.
On Thu, Jan 24, 2013 at 9:55 PM, Robin Neatherway
[email protected]:
This seems like a reasonable point of view to take re typeof. The string
quoting problems are the main thing in that case.Replying also to rneatherway#1https://github.com/rneatherway/fsharpbinding/issues/1#issuecomment-12635767(let's continue discussion here):
I noticed that the .>>? problems are transient depending on whether or
not that code is followed by another definition. Regarding fsi, I think you
are right and we should probably turn off highlighting there as it is quite
fragile.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/70#issuecomment-12646250.
Feng Li
from zarchive-fsharpbinding.
Yes I see the same problem. It is quite a large chunk of elisp so I haven't braved it yet either.
from zarchive-fsharpbinding.
I might be hijacking this issue thread, but: I noticed an issue with multi-line strings. The following does not get highlighted:
let x = "btx a
abc"
It seems the space after btx causes the error, if no space is there, highlighting works fine. I think it has to do with fsharp-mode-indent.el:119 but I don't know how to fix this with regex.
from zarchive-fsharpbinding.
Thanks for the report. We should get to this sometime, but I still haven't found time to dig into that section of the code.
from zarchive-fsharpbinding.
Based on below comment, removed additional issue, will create separate issue.
from zarchive-fsharpbinding.
Please create one github issue per problem, do NOT report many problems in the same github issue.
from zarchive-fsharpbinding.
Fixed by #292
from zarchive-fsharpbinding.
I found another bad example if there are keywords inside a namespace:
open Microsoft.FSharp.Compiler.AbstractIL.Internal
from zarchive-fsharpbinding.
Keyword highlighting should be case sensitive.
from zarchive-fsharpbinding.
Closed by #496
from zarchive-fsharpbinding.
Related Issues (20)
- [github] Escaped double quotes in verbatim strings conflict with triple-quoted strings HOT 3
- NRE when creating an .fsx file in XS HOT 1
- Atom.io support? HOT 20
- fsharpbinding is not available as the default package in SublimeText package control HOT 4
- could not import MSBuildExtensionPath32 in Monodevelop HOT 11
- Can't compile code in Windows HOT 6
- Syntax highlighting doesn't cope with international chars HOT 3
- Emacs autocomplete with .net 4.5 references HOT 12
- Documentation comments in MonoDevelop are broken since new ToolTip on Linux HOT 1
- Adding Glyph to Completion output in fsautocomplete HOT 8
- Syntax highlighting: Strange output HOT 5
- [emacs] Symbol's function definition is void: -any HOT 1
- Tutorial creates empty project HOT 2
- fsharpbinding does not parse ProjectReferences? HOT 1
- fsautocomplete will not start under mono 3.2.8 in Ubuntu/Linux Trusty HOT 1
- FSX script crashing fsautocomplete. HOT 1
- fsautocomplete.exe not run with mono 3.2.8 HOT 1
- Question on error HOT 3
- Missing type info tooltips in Lubuntu 14.04 HOT 2
- Auto-completion for fsx files stops working HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zarchive-fsharpbinding.