quintanar401 / connect-kdb-q

Query execution support for KDB-Q in Atom
MIT License
7 stars 5 forks source link

Server does not switch automatically as you switch between files. #27

Open birinderk opened 6 years ago

birinderk commented 6 years ago

Currently, I can connect to two remote servers. I have test1.q and test2.q, I connect to server#1 while having test1.q selected, then execute the script. Next I select test2.q file, connect to to server#2 and execute script. When I switch back to test1.q the server still remains as server#2 instead of switching back automatically to server#1....am I doing something wrong?

quintanar401 commented 6 years ago

Please provide more details because it should use the connection that was open in an editor. There is a mapping path -> connection. Also I can't reproduce this myself with 2 files and 2 connections.

birinderk commented 6 years ago

thank you for responding so quickly! I will warn you I am really new to webdev, atom, and programming in general so I apologize ahead of time if these questions seem "obvious".

Below I have provided you more detail of the issue and tried my best as to provided as much detail as I can.

what is the problem? When switching between different files (say test1.q connected to server#1 and test2.q connected to server#2), this does not switch the originally connected server.

What do I want to happen? To be able to open a file1 (test1.q) and execute the script with a selected server (server#1 in the case of test1.q) and then open another file2 (test2.q) and execute it with another selected server (server#2 in the case of test2.q) and then be able to switch between the first file and the second file have server#1 be connected and selected when file1 is selected and server#2 be connected and selected when file2 is selected

What is currently happening? Currently, I select file1 and execute the script with the server#1 connected: file1-1

file1-2

Next, I select file2 and select server#2 to be connected and executed: file2-1

file2-2

Next, I select the tab for file1, execute it, but server#2 is automatically selected: file_switch_2to1

How I got there The kdb packages I currently have installed and up to date are connect-kdb-q, language-kdb-q, and autocomplete-kdb-q. I installed these through the settings option inside of Atom. Next I configured the the qservers_user.json file as recommended by connect-kdb-q (maybe this is the step I did incorrectly?): qservers_users_json

And finally, I restarted Atom before opening and running .q files.

I hope that was enough detail! Again, thank you for the timely response and your help is greatly appreciated :)

birinderk commented 6 years ago

Not sure my images aren't showing up, so here's a MS Word version of what I just wrote above for clarification Challenges.docx

quintanar401 commented 5 years ago

Hi,

If this is still an issue, check the following values:

Ctrl-Shift-I - open dev window

You Q file path ID: atom.workspace.getActiveTextEditor().getPath()

How IDs are mapped to servers: atom.packages.getActivePackage("connect-kdb-q").mainModule.servers.srvMap

finally you may check that srvs are ok too: atom.packages.getActivePackage("connect-kdb-q").mainModule.servers.srvs[22]