slisson / mps-tables

Table Editor Component for JetBrains MPS
Apache License 2.0
7 stars 3 forks source link

Code completion does not work inside table cells #86

Closed klemensschindler closed 9 years ago

klemensschindler commented 9 years ago

Hi,

On this repo is a small example model in which several types (enum/str/other concept) have been put side by side in a regular and a tabular editor: https://github.com/klemensschindler/table-code-completion-issue

In this example you can see that ctrl+space completion does not work inside the table editor.

Kind Regards,

Klemens

slisson commented 9 years ago

You can't edit the properties, because node.stuff[rowIndex].strProp returns a string. A constant cell is created for strings. You have to create the editable editor cell by yourself. I have built a new "createCell" operation to make that easier:

} else if (columnIndex == 3) { 
  return editorContext.createCell(node.stuff[rowIndex], -> { strProp }); 
} else if (columnIndex == 4) { 
  return editorContext.createCell(node.stuff[rowIndex], -> { enumProp }); 
}
klemensschindler commented 9 years ago

Wow, thanks a lot! Just tested against the newest version of mps-tables and it works like a charm now.

I think the createCell operation is really cool and useful to define tables!