ts proto and working with intellisense #447
Replies: 1 comment
-
I will preface this by saying I'm also working through a similar problem and want to share my current findings. I would appreciate some help if anyone else has ideas on how to ergonomically consume a Getting Intellisense WorkingI'm trying to work around this using the What works for me to get type-hints (in neovim) is to add the path {
"compilerOptions": {
"paths": {
"@/*": [
"*",
"src/*"
],
"@@/*": [
"../../*", // incorrect
"../bazel-out/k8-fastbuild/bin/*"
]
}
}
} This lets me import like: import { Example } from '@@/protos/example_pb';
import { Component } from '@/Component'; Some Additional NotesThere are other options too like I've also seen examples where more paths are included to support multiple build targets such as from bazel-contrib/rules_nodejs#3502: "paths": {
"*": [
"./*",
"./bazel-out/k8-fastbuild/bin/*",
"./bazel-out/x64_windows-fastbuild/bin/*",
"./bazel-out/x64_windows-dbg/bin/*",
"./bazel-out/k8-dbg/bin/*",
"./bazel-out/host/bin/*",
"./bazel-out/darwin-fastbuild/bin/*",
"./bazel-out/darwin-dbg/bin/*"
]
} My IssueWhat I can't get working is getting both builds and intellisense working at the same time. 1. Relative imports from workspaceimport { Example } from '../../protos/example_pb';
import { Component } from '@/Component';
2. Using path alias (
|
Beta Was this translation helpful? Give feedback.
-
Hi there,
I am coming from rules_nodejs and switching to rules_js. I'm in the process of moving our existing grpc-web ts libraries (generated using rules_proto_grpc) to the ts_proto_library.
At a high level, I've gotten a ts_proto_library to be used by a ts_project rule which is then bundled with esbuild.
The problem I'm having now is with intellisense. What options are there for handling intellisense. In the one proto_grpc example available in this repository, it seems like they are directly emitting the output files in the user's source directory. Are there ways to avoid this, such as pointing my intellisense tools to look into my bazel-bin directory or the like.
I'm quite sure this has been discussed before, but I'm just curious what the options are now with rules_ts and the ts_proto_library. Is it only to copy ts_proto_library output files back to the source directoy, or are there other options?
Beta Was this translation helpful? Give feedback.
All reactions