Opened 5 years ago
Closed 5 years ago
#5666 closed defect (fixed)
OMEdit propose invalid identifier for Constant block
Reported by: | Owned by: | Adeel Asghar | |
---|---|---|---|
Priority: | blocker | Milestone: | 1.14.0 |
Component: | OMEdit | Version: | v1.14.0-dev-nightly |
Keywords: | Cc: |
Description
I have noticed that OMEdit (OpenModelica v1.14.0-dev-26754-g0218247f06 (64-bit) on Windows 7) is now proposing invalid identifier for Constant block now.
Before there are no such thing. (Checked in v1.13 on Ubuntu).
Way to reproduce:
- Create new class
- Drag a constant block an accept proposed name - const
- Drag another constant block - OMEdit proposing constant instead of const2 as it was before.
Same result if you create any block and name it const. Afterward a new Constant block - constant is proposed again.
Change History (5)
comment:1 by , 5 years ago
comment:2 by , 5 years ago
Milestone: | Future → 1.14.0 |
---|---|
Priority: | normal → blocker |
Status: | new → accepted |
follow-up: 4 comment:3 by , 5 years ago
Of course we need to filter out keywords, but we also need to consider the annotation defaultComponentName
.
In this case defaultComponentName="const"
, so when dragging one should obtain const
, then const2
, const3
, etc.
comment:4 by , 5 years ago
Replying to casella:
Of course we need to filter out keywords, but we also need to consider the annotation
defaultComponentName
.
In this case
defaultComponentName="const"
, so when dragging one should obtainconst
, thenconst2
,const3
, etc.
This is exactly what I changed. I thought if we already have a component with default name then we should use the model name for the next component instead of the defaultComponentName
annotation.
comment:5 by , 5 years ago
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
Fixed in 820af85/OpenModelica.
I have updated according to Francesco's suggestion i.e., use default component name is its present for new name suggestions otherwise use the component name.
It now also checks for Modelica keywords.
This is a recent change:
https://github.com/OpenModelica/OpenModelica/commit/66641cb7051c20446b710f2cb5ac2219de7a9753
@adeas31: we need to filter out keywords.