Comments (4)
I tried to reproduce this from your screenshot + requirements.txt, but was unsuccessful. Please provide a complete, minimal code sample (as text!) that reproduces the behavior you are seeing. The screenshot you provided above is missing imports, etc.
from pylance-release.
Here's one where it can't find database in cantools.
can_send.txt
from pylance-release.
Here is the log for that.
language_server.txt
from pylance-release.
where can one finds DbcMessage
? could you provide full code including import statements and what packages needed to be installed?
that said, for your can_send.txt
, some function returned Union
so code requires some kind of cast/narrow/typeguard to specify which type code assumes.
import can
import time
import cantools
import cantools.database
from cantools.database.can.database import Database
from cantools.database.can.message import Message
bus = None
def send_message(msg: Message):
signal_values = {}
signal_db = {}
for signal in msg.signals:
signal_values[signal.name] = signal.minimum
signal_db[signal.name] = {'minimum':signal.minimum, 'maximum':signal.maximum}
while True:
data = msg.encode(signal_values)
message = can.Message(arbitration_id=msg.frame_id, data=data, is_extended_id=True)
assert(bus is not None)
bus.send(message)
for key in signal_values:
signal_values[key] += 1
if signal_values[key] > signal_db[key]['maximum']:
signal_values[key] = signal_db[key]['minimum']
time.sleep(1) # Send a message every second
if __name__ == '__main__':
bus = can.Bus(interface='udp_multicast', channel='239.0.0.1', port=10000, receive_own_messages=False)
db = cantools.database.load_file('../envgo/dbc/xerotech_battery_j1939.dbc')
assert(isinstance(db, Database))
for msg in db.messages:
if 'VCU' not in msg.senders:
send_message(msg)
break
from pylance-release.
Related Issues (20)
- Consecutive comment lines are not foldable in Python but are in (at least some) other languages HOT 1
- Pylance makes type hints in Python unusable for me HOT 14
- `"python.analysis.autoImportCompletions": false` not working. HOT 1
- Syntax highlighting issue for a valid conditional logic when type hints provided HOT 3
- PyLance crashes when setting node option '--no-deprecation' HOT 24
- My VSCode keep freezing because of Pylance HOT 1
- pylance bug HOT 1
- F2 renaming not working across all python files HOT 2
- Better string completions HOT 1
- import side by side in standalone file didn't work HOT 1
- Problema com desempenho HOT 1
- wtegt HOT 1
- wtegt HOT 1
- wtegt HOT 1
- "Not a known attribute" error HOT 12
- pylance crashing all the time HOT 1
- Pylance Performance Issue HOT 1
- pylance crash: Allocation failed - JavaScript heap out of memory HOT 16
- report HOT 2
- issue HOT 1
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 pylance-release.