Skip to content
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

WIP: YASNCB (Yet Another Strict Null Checks Branch) #1703

Draft
wants to merge 73 commits into
base: dev
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
aa2250b
Fix nulls/undefineds and improve repl info parser for params
corasaurus-hex Apr 30, 2022
a697c11
Stop using deprecated function and use our own instead
corasaurus-hex Apr 30, 2022
02d317d
Fix an undefined value in utilities
corasaurus-hex Apr 30, 2022
02960ca
Help typescript out with some type assertions in cursor-doc model
corasaurus-hex Apr 30, 2022
0f72124
Fix null checks for project-types
corasaurus-hex May 1, 2022
9426650
Fix null checks for completion provider
corasaurus-hex May 1, 2022
c73129e
Fix nulls in src/connector.ts
corasaurus-hex May 1, 2022
3dd6b85
Fix null in src/converters.ts
corasaurus-hex May 1, 2022
6e6640f
Fix nulls in cursor-doc indent and improve performance
corasaurus-hex May 1, 2022
5aad863
Fix nulls in clojure-lexer
corasaurus-hex May 1, 2022
0510888
Fix nulls in lexer
corasaurus-hex May 1, 2022
347e7eb
Fix nulls in paredit.ts
corasaurus-hex May 1, 2022
2527798
Fix nulls for _rangesForSexpsInList
corasaurus-hex May 1, 2022
be6765b
Fix remaining nulls for token-cursor.ts
corasaurus-hex May 1, 2022
46fa6ad
Fix more nulls in paredit
corasaurus-hex May 1, 2022
ff9f09d
Fix nulls in undo.ts
corasaurus-hex May 1, 2022
6e17118
Fix types for evaluating custom snippets
corasaurus-hex May 1, 2022
39c3208
Fix types in repl-session
corasaurus-hex May 1, 2022
e2622a2
Fix null checks for clojuredocs
corasaurus-hex May 1, 2022
7f77027
Fix debugger-related null checks
corasaurus-hex May 1, 2022
28cf0f3
Fix more null checks in the debugger
corasaurus-hex May 1, 2022
25af9b9
Another null check issue fixed, this time in doc-mirror
corasaurus-hex May 1, 2022
4043c42
Fix null check issues in src/evaluate.ts
corasaurus-hex May 1, 2022
74ab8f9
Fix some null check issues in extension tests
corasaurus-hex May 1, 2022
6a04743
Fix null check issues in src/extension.ts
corasaurus-hex May 1, 2022
b91edb1
Fix a ton of null check issues in extension.ts for highlighting
corasaurus-hex May 1, 2022
a58fbf1
Fix live-share.ts null check issues
corasaurus-hex May 1, 2022
30cc621
Fix a number of strict null check issues in lsp code
corasaurus-hex May 1, 2022
6e26d72
Fix null check issues in providers
corasaurus-hex May 1, 2022
387326f
Fix strict null check issue in repl-history.ts
corasaurus-hex May 1, 2022
c8c7ee7
Fix strict null check issue in when-contexts.ts
corasaurus-hex May 1, 2022
cb079b5
Fix strict null check issues for src/connector.ts
corasaurus-hex May 1, 2022
20d0f2c
Fix strict null check issues for src/evaluate.ts
corasaurus-hex May 1, 2022
1cddd85
Fix strict null check issues for src/nrepl/bencode.ts
corasaurus-hex May 1, 2022
49a0f0f
Fix strict null check issues for src/nrepl/connectSequence.ts
corasaurus-hex May 1, 2022
b9cdce3
Fix strict null check issues for src/nrepl/index.ts
corasaurus-hex May 1, 2022
d608036
Fix strict null check issues for src/nrepl/jack-in-terminal.ts
corasaurus-hex May 1, 2022
b33def4
Fix strict null check issues for src/nrepl/jack-in.ts
corasaurus-hex May 1, 2022
2dc2abf
Fix strict null check issues for src/nrepl/project-types.ts
corasaurus-hex May 1, 2022
407b589
Fix strict null check issues for src/nrepl/repl-start.ts
corasaurus-hex May 1, 2022
5e2ed4b
Fix strict null check issues for src/paredit/extension.ts
corasaurus-hex May 1, 2022
6ff6e9b
Fix strict null check issues for src/project-root.ts
corasaurus-hex May 1, 2022
e8c4cb1
Fix strict null check issues for src/providers/definition.ts
corasaurus-hex May 1, 2022
b6b8db4
Fix strict null check issues for src/providers/signature.ts
corasaurus-hex May 1, 2022
aea1267
Fix strict null check issues for src/refresh.ts
corasaurus-hex May 1, 2022
c6fd333
Fix strict null check issues for src/results-output/results-doc.ts
corasaurus-hex May 1, 2022
8425e1a
Fix strict null check issues for src/statusbar.ts
corasaurus-hex May 1, 2022
c3735e3
Fix strict null check issues for src/testRunner.ts
corasaurus-hex May 1, 2022
1cdcd92
Fix strict null check issues for src/util/cursor-get-text.ts
corasaurus-hex May 1, 2022
fcf14e0
Enable strict null checks for typescript
corasaurus-hex May 1, 2022
adfe62a
Run prettier formatter
corasaurus-hex May 1, 2022
b119164
Rename getSession => tryToGetSession and make another getSession
corasaurus-hex May 1, 2022
5da7c79
Restore whitespace
corasaurus-hex May 1, 2022
ac8f195
Remove assertions that are no longer needed due to new function
corasaurus-hex May 1, 2022
c1417db
No need to set to a variable before use
corasaurus-hex May 1, 2022
f310e64
More formatting
corasaurus-hex May 1, 2022
859a6bb
Minimize more changes to connector
corasaurus-hex May 1, 2022
7ac6f57
Whoops, use a record type not a map type
corasaurus-hex May 1, 2022
1e921d6
Ensure same behavior here
corasaurus-hex May 1, 2022
61437fe
Split project root local fns into tryToGet + get
corasaurus-hex May 1, 2022
d0cd19c
Move undefined check closer to where it is needed
corasaurus-hex May 1, 2022
0778866
Forgot a bang !
corasaurus-hex May 1, 2022
857054d
Swap out use of regex for much faster substring search
corasaurus-hex May 1, 2022
5106ee8
Use function instead of try + assert
corasaurus-hex May 1, 2022
18d7761
Compare against the right types
corasaurus-hex May 1, 2022
3d1aec3
Get rid of unused import
corasaurus-hex May 1, 2022
b83c26d
Move type checking functions out to an ns without vscode
corasaurus-hex May 1, 2022
13d7e82
Fix some null checks
corasaurus-hex May 1, 2022
bc7fadd
Fix the token cursor genericized function
corasaurus-hex May 1, 2022
cd0d893
Reformat the tsconfig
corasaurus-hex May 1, 2022
6414e32
Use prettier to format JSON files in the project
corasaurus-hex May 1, 2022
f5c1fbd
Debug lsp downloads
corasaurus-hex May 1, 2022
df16f82
Add some debugging so we can figure out why integration tests are
corasaurus-hex May 1, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix more null checks in the debugger
  • Loading branch information
corasaurus-hex committed May 1, 2022
commit 28cf0f3b4e1adf36672b3d4d0819f35a14aed09d
9 changes: 7 additions & 2 deletions src/debugger/util.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { LispTokenCursor } from '../cursor-doc/token-cursor';
import { assertIsDefined } from '../utilities';

function moveCursorPastStringInList(tokenCursor: LispTokenCursor, s: string): void {
const [listOffsetStart, listOffsetEnd] = tokenCursor.rangeForList(1);
const range = tokenCursor.rangeForList(1);
assertIsDefined(range, 'Expected range to be found!');
const [listOffsetStart, listOffsetEnd] = range;
const text = tokenCursor.doc.getText(listOffsetStart, listOffsetEnd - 1);

const stringIndexInList = text.indexOf(s);
Expand All @@ -22,7 +25,9 @@ function moveTokenCursorToBreakpoint(
debugResponse: any
): LispTokenCursor {
const errorMessage = 'Error finding position of breakpoint';
const [_, defunEnd] = tokenCursor.rangeForDefun(tokenCursor.offsetStart);
const range = tokenCursor.rangeForDefun(tokenCursor.offsetStart);
assertIsDefined(range, 'Expected range to be found!');
const [_, defunEnd] = range;
let inSyntaxQuote = false;

const coor = [...debugResponse.coor]; // Copy the array so we do not modify the one stored in state
Expand Down