sierrawireless / org.eclipse.koneki.ldt Goto Github PK
View Code? Open in Web Editor NEWKoneki project repository (koneki.ldt)
Home Page: http://www.eclipse.org/koneki/ldt
Koneki project repository (koneki.ldt)
Home Page: http://www.eclipse.org/koneki/ldt
could be useful to that one day so that this can of pattern can dealt with:
local file = assert(io.open("foobar", "w+"))
file:write("plop") -- no completion on file var.
I guess it would be hard to document assert in a way to say it returns the same type of object given as parameter...
So something like:
local myfile = assert(io.open("foobar", "w+"))
--- myfile [file]
myfile:write("plop") -- myfile is known as a file var.
If the short description contains a dot, the short description is shorter than expected...
e.g.
-------------------------------------------------------------------------------
-- Returns information about an existing battle.net conversation
-- @function [parent=#global] BNGetConversationInfo
-------------------------------------------------------------------------------
ends up with "Returns information about an existing battle." for the short description and "net conversation" for the description
Usually local variable are colored in grey and function keyword (e.g. assert, require, ...) are in bold font, but when I open some existing files without error only string , number and structural keyword (e.g. local, function, ...) are colored.
This bug occur only on some files, others files in the same project are correctly colored.
This bug is reproducible.
See on Developer Studio For Aleos 1.0.0.201204261652.
See attached "main.lua" file.
local airvantage = require "airvantage" -- Library to access AirVantage
local device = require "devicetree"
local system = require "system"
local serial = require "serial"
local sched = require 'sched'
local serial = require "serial" -- Serial lib
local os = require "os" -- Operating system lib
local string = require 'string'
require 'pack'
local sendcommand =require "sendcommand"
local commandreceive =require "commandreceive"
-- Global Variables used for thread communication
contrast = 9
screen_brightness = 50
key_brightness = 50
line1 = string.rep(' ', 16)
line2 = string.rep(' ', 16)
----------------------------------------------------
-- The callback function that receives the commands
-- and prints the variable path and the table value
-- Need to return "ok" at the end
function line1command (assetInstance, value, path)
print(path)
print (value[1])
sendcommand.line1(value[1])
return "ok"
end
----------------------------------------------------
-- The callback function that receives the commands
-- and prints the variable path and the table value
-- Need to return "ok" at the end
function line2command (assetInstance, value, path)
print(path)
print (value[1])
sendcommand.line2(value[1])
return "ok"
end
----------------------------------------------------
-- The callback function that receives the commands
-- and prints the variable path and the table value
-- Need to return "ok" at the end
function contrastcommand (assetInstance, value, path)
print(path)
print (value[1])
contrast = value[1]
sendcommand.contrast(contrast)
return "ok"
end
----------------------------------------------------
-- The callback function that receives the commands
-- and prints the variable path and the table value
-- Need to return "ok" at the end
function brightnesscommand (assetInstance, value, path)
print(path)
print (value[1])
sendcommand.brightness(value[1], value[2])
return "ok"
end
--------------------------------------------------------------------------------
-- Check if the serial port has been reserved for our use
-- if not, reserve it and reboot to gain control
local function reserve_serial_port ()
local serial_reserve_var = "system.aleos.reserve.ser0"
local serial_available = assert (device.get(serial_reserve_var))
if serial_available ~= 1 then
print ("WARNING","serial port not available, reserving it now...")
local result = assert (device.set(serial_reserve_var, 1))
print ("WARNING","Serial port Reserved ok, rebooting now...")
system.reboot("Reserving Serial Port")
sched.wait(30) -- stop here until the reset occurs
end
print ("Serial Port has been reserved for our use.")
sched.wait(1)
end
--------------------------------------------------------------------------------
-- open and configure the serial port
local function open_serial_port ()
local portname = "/dev/ttyS0"
local serial_config =
{ parity = "none", flowControl = "none", numDataBits = 8, numStopBits = 1, baudrate = 19200 }
local serialdev = assert (serial.open(portname, serial_config))
serialdev:settimeout(0) -- set a timeout in seconds
sched.wait(1)
return serialdev
end
--------------------------------------------------------------------------------
-- Read up to a buffer full of data from the serial port
local function read_serial_port (sdevice)
while true do
local full_buffer, err, partial_buffer = sdevice:read(250) -- read data from serial port
if full_buffer then
return full_buffer
elseif partial_buffer then
return partial_buffer
else
if not string.match (err, 'timeout') then -- if this wasn't a timeout with no data
return nil, err
end -- timeout with no data, continue waiting...
end
end
end
local function doframes (dataframes)
local i
for i = 1, #dataframes do
commandreceive.decodeframes (dataframes[i])
end
end
local function read_serial (serdev)
local dataframes
while true do
dataframes = commandreceive.getframes (read_serial_port(serdev))
doframes (dataframes)
dataframes = {}
end
end
local function main ()
airvantage.init ()
local crystalasset = assert (airvantage.newasset("Crystal"))
assert (crystalasset:start(), "Can't register Agent")
sendcommand.init (crystalasset)
commandreceive.init (crystalasset)
--Ensure we are talking to correct server
device.init()
device.set ("config.server.url", "http://edge.m2mop.net/device/awtda/com")
print (device.set ("config.agent.deviceId", "CA0012101361001"))
server, status = device.get("config.server.url")
-- Register Callback Functions Against Branches
-- Note the name of the command in the tree
crystalasset.tree.commands.Line1 = line1command
crystalasset.tree.commands.Line2 = line2command
crystalasset.tree.commands.Contrast = contrastcommand
crystalasset.tree.commands.Brightness = brightnesscommand
local i
reserve_serial_port ()
serdev = open_serial_port ()
local threadname = sched.run (function()read_serial (serdev)end)
sendcommand.getline1 ()
sendcommand.getline2 ()
sched.wait (5)
crystalasset:pushdata("uplink", {line1=line1, timestamp=os.time()}, "hourly")
crystalasset:pushdata("uplink", {line2=line2, timestamp=os.time()}, "hourly")
sendcommand.contrast (contrast)
sendcommand.brightness (screen_brightness)
-- Push them into hourly queue
while true do
-- Connect to the server and push all the data up
airvantage.triggerpolicy("*")
airvantage.connecttoserver ()
sched.wait(30)
end
os.exit()
end
sched.run(main)
sched.loop()
Writing following documentation
-- @usage local i
-- local v
-- local h
Resulting display is
local i
local v
local h
The shift on the first line have to be sorted out.
If you name a function or a parameter "type" in the documentation language, it is being ignored.
Hi,
While trying to run new introspection tests as described.
lunatest
is not loadable. Do I need to put it in $LUA_PATH
or is bootstrap.py
suposed to do it?
Regards
Here is the stack
$ ./bin/luajit runner.lua
./bin/luajit: runner.lua:30: module 'lunatest' not found:
no field package.preload['lunatest']
no file '/usr/local/share/lua/5.1/lunatest.lua'
no file '/usr/local/share/lua/5.1/lunatest/init.lua'
no file '/home/kkin-foo/.luarocks/share/lua/5.1/lunatest.lua'
no file '/home/kkin-foo/.luarocks/share/lua/5.1/lunatest/init.lua'
no file './lunatest.lua'
no file './lunatest/init.lua'
no file '/usr/local/share/lua/5.1/lunatest.lua'
no file '/usr/local/share/lua/5.1/lunatest/init.lua'
no file '/usr/local/lib/lua/5.1/lunatest.lua'
no file '/usr/local/lib/lua/5.1/lunatest/init.lua'
no file '/usr/share/lua/5.1/lunatest.lua'
no file '/usr/share/lua/5.1/lunatest/init.lua'
no file '/d/koneki.ldt/libraries/doctemplates/lunatest.lua'
no file '/d/koneki.ldt/libraries/luadocumentor/lunatest.lua'
no file '/d/koneki.ldt/libraries/markdown/lunatest.lua'
no file '/d/koneki.ldt/libraries/metalua/lunatest.lua'
no file '/d/koneki.ldt/libraries/modelsbuilder/src/lunatest.lua'
no file '/d/penlight/lua/lunatest.lua'
no file '/d/koneki.ldt/libraries/templateengine/lunatest.lua'
no file '/d/koneki.ldt/libraries/luadbgpclient/lunatest.lua'
no file '/d/luasimplexmlparser/lunatest.lua'
no file '/d/serpent/src/lunatest.lua'
no file '/usr/local/lib/lua/5.1/lunatest.so'
no file '/home/kkin-foo/.luarocks/lib/lua/5.1/lunatest.so'
no file './lunatest.so'
no file '/usr/local/lib/lua/5.1/lunatest.so'
no file '/tmp/org.eclipse.koneki.ldt/libraries/luadbgpclient/tests/test-environments/luajit2/lib/lua/5.1/lunatest.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
[C]: in function 'require'
runner.lua:30: in main chunk
[C]: at 0x00404a10
Example:
local foo = "bar"
local stuff = "stuff"..fo
When triggering variable completion after typing "..fo", nothing appears.
iIt seems the issue doesn't happen when variable to complete is before ".." operator.
Seen on
Developer Studio for ALEOS
Version : 1.0.0.201204261652
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.