-
Notifications
You must be signed in to change notification settings - Fork 29k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Line terminators in programming languages #96142
Labels
Milestone
Comments
Here is some text with such a character: var Input;
var lastInput;
var position =0;
var ftext = [
"Und", "dann", "eines"];
var opacityTitle=1;
document.addEventListener("keydown", function(event) {
if (event.which >= 32 && event.which <= 122 && event.which != lastInput) {
lastInput = event.which;
advance();
}
else if (event.which == 8) {
lastInput = event.which;
strikeOut();
}
});
document.addEventListener("keydown", function(event) {
document.getElementById("fade").style.opacity = opacityTitle;
opacityTitle -= 0.06;
});
function advance(){
document.getElementById("butt").innerHTML += "<p id=\"" + position + "\" class=\"word\">" + ftext[position] + "</p>";
var nextWord = document.createElement("P");
var textnode = document.createTextNode(ftext[position]);
nextWord.appendChild(textnode);
nextWord.classList.add("word");
document.getElementById("butt").appendChild(nextWord);
position++;
var foo=3;
var bar=4;
}
function strikeOut(){
document.getElementById("butt").innerHTML = lastInput;
} |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Extracted from microsoft/TypeScript#38078
VS Code currently recognizes CRLF, CR and LF as end-of-line sequences.
But programming languages have different definitions for what constitutes a line terminator. Here is a summary from some of the specifications I found:
Specifications:
Some language servers might use their specification variant for what a line is, so the
(line,char)
coordinates used for document change events, reference positions, diagnostics etc. might be off for files containingLS
,PS
, orNEL
.Since the characters
LS
,PS
, orNEL
are very rarely used in practice, and most likely they appear unintentionally in source code (through copy-pasting), I suggest we prompt users when such a file is opened and ask them to "fix" the line terminators for the file. Fixing would mean to replaceLS
,PS
, orNEL
with the current configured EOL sequence.The text was updated successfully, but these errors were encountered: