Commit Graph

19 Commits

Author SHA1 Message Date
Mihovil Ilakovac
8f136fb5cd
Make sure entity declaration is not used in the Wasp file (#2152) 2024-07-09 23:44:56 +02:00
Mihovil Ilakovac
8ead2e0910
Using Prisma file alongside Wasp (#2035) 2024-07-03 13:51:29 +02:00
Filip Sodić
cbd7310b16
Implement Wasp SDK generation (#1626) 2024-01-29 16:08:15 +01:00
Martin Šošić
bc9e1b6bce
Update LSP to work with restructuring (#1650) 2024-01-29 16:05:56 +01:00
Filip Sodić
6f0714ad23
Create restructuring prototype (#1584) 2024-01-29 14:00:20 +01:00
Martin Sosic
7297dfab3d Fixed old hlint warnings/suggestions. 2024-01-08 15:54:10 +01:00
Craig McIlwrath
0f9726b7a1
[waspls] use the wasp project root instead of the workspace root (#1393)
* calculate project root via location of .wasp file

previously, waspls used workspace root, which was incorrect if you opened a
workspace larger than the wasp project.

this does not add support for multi-project workspaces.

* update changelog with waspls scaffolding info
2023-08-11 08:18:37 -04:00
Craig McIlwrath
d12b403e7d
[waspls] improves LSP scaffolding (#1381)
* create directories when scaffolding, if needed

* refresh export cache after scaffolding

* better process for ensuring a blank line between old code and new scaffolded code
2023-08-10 10:01:20 -04:00
Craig McIlwrath
ea70a8e4bb
[waspls] fix client directory module resolution (#1372)
Previously, waspls incorrectly thought that importing `@client/file.jsx` could be referencing the file `src/client/file.tsx`. But this JS/TS "merging" is only correct on the server (for reasons that are not explained by the TS documentation on module resolution). This commit fixes that by requiring exact matches for external imports beginning with `@client`.

This incorrect behavior manifested as several different bugs:
- Not reporting missing `.jsx` files when a `.tsx` file with the same name exists.
- Go-to definition going to the `.tsx` file instead of the `.jsx` file when the external import ends in `.jsx`.
- Scaffold actions suggestions scaffolding in both the `.jsx` and `.tsx`files.

This commit fixes all of these buggy behaviors.
2023-07-28 10:49:09 -04:00
Mihovil Ilakovac
7c09e3964b
Updates LSP templates (#1375) 2023-07-28 10:33:04 +02:00
Craig McIlwrath
76d9fc4213
[waspls] Add code actions for scaffolding external code (#1316)
When an external import tries to import a symbol from a TypeScript/JavaScript file, waspls now offers quickfix code actions to scaffold a function in that file.

It uses the surrounding context of the external import to determine what code to write for the code action. See [`ScaffoldTsSymbol.hs`](457911d5e9/waspc/waspls/src/Wasp/LSP/Commands/ScaffoldTsSymbol.hs) for a detailed description of how it works. At a high level, there is a `templateForFile` function in `Wasp.LSP.Commands.ScaffoldTsSymbol` that selects the correct template from `data/lsp/templates/ts`. For example, `action.fn.ts` contains a template for scaffolding an `action` function in a TypeScript file and would be used when a code action is requested with the cursor at the location marked by `|`:

```wasp
action createTask {
  fn: import { createTask } from "@server/actions.js"|
}
```

The scaffold action runs as a [LSP command](https://microsoft.github.io/language-server-protocol/specifications/specification-3-16/#workspace_executeCommand). To prepare for wanting to define more commands in waspls in the future, this PR also introduces the concept of `Commands` (`Wasp.LSP.Commands.Command`) that define some properties about each command waspls wants to handle.
2023-07-26 08:00:16 -04:00
Craig McIlwrath
8b1d6a96ab
[waspls] implement goto definition for declarations (#1310) 2023-07-18 08:16:26 -04:00
Craig McIlwrath
2d3f0e116c
[waspls] cleanup extimport code (#1292)
mainly refactoring. also updates CI workflow to run packages/ts-inspect tests.
2023-07-07 08:21:33 -04:00
Craig McIlwrath
c1d86b1f91
Show multiple parse errors from Wasp Analyzer (#1298)
* allow multiple errors to come out of analyzer

basically just plumbing. does add one new thing: all the concrete parse
errors get reported now 🥳

* add statement level error recovery to abstract parser

* add expression level parse recovery

recovers from errors inside dict entries, lists,
and tuples.

* document parser error recovery

* run formatter
2023-06-29 12:34:31 +02:00
Craig McIlwrath
d5c04a002a
[waspls] fix debouncer tests (#1284) 2023-06-23 10:28:22 -04:00
Craig McIlwrath
7c0d13d242
[waspls] diagnostics for external imports and goto definition (#1268) 2023-06-22 15:37:07 -04:00
Craig McIlwrath
e43b8f986c
[waspls] add dictionary autocomplete and signature help (#1230) 2023-06-20 07:31:20 -04:00
Craig McIlwrath
00e4966f06
Add test framework for language server autocompletion (#1223) 2023-06-01 11:03:01 -04:00
Martin Šošić
99487ff2f7
waspls is now part of waspc (#716) 2022-09-08 13:56:37 +02:00