3 ms·
Compilers are not the only tools worth considering. Language services are also important, and language services see most use when the code is half-written and m
by Arnavion 8y ago
Compilers are not the only tools worth considering. Language services are also important, and language services see most use when the code is half-written and malformed.
func foo() {
b
func bar() {
}
`foo` is still in the process of being written and the user has invoked auto-completion after typing `b`. It's good if the parser can recover and parse the `bar` function so that the language service can suggest `bar` there.
- hinkley 8y agoAs I sit in my fancy editor typing away code fragments I am often struck by the notion that my productivity would improve if the analyzer remembered something about the last clean parse of the file. If you parsed the file as a diff against the last known good state you should be able reason a lot more about what’s going on. Especially if the programmer has a habit of writing code incrementally.
- hinkley 8y agoInstead, what my editor does is autocomplete code blocks or statements in order to keep the parse tree consistent. But my editing style causes it to constantly jam me up when I’m trying to change string construction, Boolean logic, function calls or function chaining.