CXuesong / MwParserFromScratch

A basic .NET Library for parsing wikitext into AST.
Apache License 2.0
18 stars 5 forks source link

Migrate IWikitextSpanInfo from offset-based to line/column-based #7

Closed CXuesong closed 7 years ago

CXuesong commented 7 years ago

Ref = Microsoft/language-server-protocol/issues/96 .

Though it might not be so intuitive, but felixfbecker's idea may worth a note.

I guess the reasoning is imagine a range from line 1 - 3. If the user is typing in line 2, end column will stay the same. The file end pos would constantly update.

This may help if incremental AST building is to be implemented in the future.

Another reason is that IXmlLineInfo, IJsonLineInfo, and System.CodeDom.Compiler.CompilerError.Line/Column are all line/column-based… Just try to follow the trend.

Also, I wanna LSP XD