You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a file diagnostics.R with the following content:
sum(1:10, na.rm+=1)
The file is obviously not parse-able but calling lintr::lint("diagnostics.R") will result in the following error:
Error in vapply(eq_assign_locs, next_with_parent, pc = pc, integer(1)) :
values must be length 1,
but FUN(X[[1]]) result is length 0
Backtrace:
1: vapply(eq_assign_locs, next_with_parent, pc = pc, integer(1))
2: fix_eq_assigns(fix_column_numbers(fix_tab_indentations(source_file)))
3: get_source_file(source_file, error = lint_error)
4: get_source_expressions(filename)
5: lintr::lint("diagnostics.R")
The text was updated successfully, but these errors were encountered:
This commit fixes the handling of source code such as
`x=`, and `sum(1:10, na.rm += 1)`
for which the parse data stops at the `=` in these cases where the last token is always EQ_ASSIGN. This PR adds a condition that if the last token is EQ_ASSIGN then fix_eq_assigns should not do anything because next_with_parent no longer works.
From REditorSupport/languageserver#218:
Create a file
diagnostics.R
with the following content:The file is obviously not parse-able but calling
lintr::lint("diagnostics.R")
will result in the following error:The text was updated successfully, but these errors were encountered: