Comments (8)
It looks like TestRequest
is a message and you are creating a message by new TestRequest()
. The constructor accepts another instance of TestRequest
or an object that looks like TestRequest
or no value. In case you pass one of them and it is a value, all the properties will be deeply cloned and assigned to corresponding properties in this message. So, IDE works quite fine here.
Here is an example of actually running the request with passing the parameters and IDE works as expected as well:
Properties are also normally well-documented with jsdoc comments. I don't have WebStorm (I use VSCode) so I can't validate it there, however there is nothing special in the generated code that normal IDE would not be able to support
from ngx-grpc.
How do you know what object you should pass in a message constructor? For example in EchoRequest
(message
, shouldThrow
and timestamp
)?
In our case I can see that it is RecursivePartial<GetMessagesByFolderRequest>
but IDE suggest only methods:
So, I need to go to the constructor or to the documentation to know what params I should pass:
from ngx-grpc.
The first two, that are offered by IDE are in fact getters. Those technically are methods but not ordinary ones, they behave like normal properties on the object. What does IDE insert in case you hit enter on let's say mailbox
getter?
Here is what is displayed in VSCode:
from ngx-grpc.
If I choose getter method, IDE inserts the following:
from ngx-grpc.
I have just tried to use suggestions in VS Code and they work:
Apparently, the question is in the WebStorm.
from ngx-grpc.
Yes, I think so too.
Probably try to raise the issue at JetBrains team. If you find a way to make it more WebStorm-friendly (maybe some special comment for each getter or similar) please let me know.
from ngx-grpc.
I just had a random idea that might help here. Could you change in the generated code constructor TestRequest(_value?: RecursivePartial<TestRequest>)
to constructor TestRequest(_value?: RecursivePartial<TestRequest.AsObject>)
and say whether this resolves the issue? This structure of this object is actually the same as the message but with normally defined properties.
from ngx-grpc.
Hi
This way it works as expected:
from ngx-grpc.
Related Issues (20)
- update @improbable-eng/grpc-web dependency HOT 3
- Combine web worker and ImprobableEngGrpcWebClientModule? HOT 2
- How to reduce timeout or deadline? HOT 1
- do I need to handle connection close in server side HOT 4
- No licence specified at npm for @ngx-grpc/grpc-web-client HOT 1
- int64 is a string HOT 8
- Why are all properties generated in interfaces optional? HOT 3
- When I write in the settings file pbconf generate false. HOT 4
- How to decode grpc-web-text HOT 2
- Angular 16 issue HOT 1
- ngx-grpc client service throwing error HOT 1
- Running the plugin as a standalone executable throws Error: Cannot find module 'tslib' HOT 7
- [Question] GrpcHandler undefined HOT 1
- Question regarding google.api.http HOT 1
- Client Side Load Balancing
- Question: How can I use two GRPC service instances? HOT 5
- Any type usage help HOT 2
- Error: InjectionToken GRPC_CLIENT_FACTORY in tests after standalone migration
- Support stripping Enum prefixes
- Improper regex usage in the proto-gen getRelativeTypeName method HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-grpc.