Commonjs pb exports do not carry intellisense
@lukesandberg arbeitet bereits daran.
Seit 09.6.2021.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
What version of protobuf and what language are you using?
Version: v3.6.1
Language: Javascript
What operating system (Linux, Windows, ...) and version?
Ubuntu 20.04, x86_64
What runtime / compiler are you using (e.g., python version or gcc version)
protoc pre-built compiler
What did you do?
Steps to reproduce the behavior:
- Create a sample protoc file, here
simple.proto. I took it from this example, modified to "proto3" - Use the compiler to autogen JavaScript code:
protoc --js_out=import_style=commonjs,binary:. simple.proto - Use the default export as an object with expected Schema:
const Schema = require('./simple_pb'); - Attempt to use the expected Class(es) on that object:
const test = new Schema.Test1(); - See that you do not receive intellisense for the
Test1()class, nor for expected operations it's instances
What did you expect to see
Intellisense for the simple_pb operations on the default export.
What did you see instead?
No Intellisense, but the operations themselves do execute (setting values, serialzing to Binary).
I was able to "fix" the issue by changing the last line of the simple_pb.js file. The goog export extension did not work, so I just commented it out and spread the goog and proto objects into module.exports:
module.exports = {...goog, ...proto};
// goog.object.extend(exports, proto);
- Vorherrschende Sprache
- JavaScript
- Sterne
- 471
- Forks
- 91
- Ø Merge
- 3 Std. 57 Min.
- Gemergte PRs (30 T.)
- 2
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus protocolbuffers/protobuf-javascript
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 30/100
protocolbuffers/protobuf-javascript#248 · 1 Kommentar · 13 Reaktionen ·
-
question
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 45/100
protocolbuffers/protobuf-javascript#222 · 9 Kommentare ·
-
Why map.js sort keys? Offenenhancement port-fix triaged
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
protocolbuffers/protobuf-javascript#185 · 1 Kommentar ·
-
enhancement port-fix triaged
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
protocolbuffers/protobuf-javascript#182 · 3 Kommentare · 1 Reaktion ·
Alle Issues in protocolbuffers/protobuf-javascript
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
-
area-deployment area-integrations triage:bot-seen
Schwierigkeit 2/5 Ein halber Tag Anfängerfreundlichkeit 86/100
-
Issue-Bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
sugarlabs/musicblocks#8924 ·
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
ArduPilot/ardupilot_wiki#8088 ·
-
[BUG] createTool tools cannot be registered with Mastra when exactOptionalPropertyTypes is enabled Offencustomer-eng status: needs triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100